Skip to main content

All Questions

0 votes
1 answer
186 views

This code returns 301 permanently moved while the same script worked properly

this is part of java script to collect some data in .xls file from a website (https://web.expasy.org/protparam/). The website has a box in which we put some character, then it computes and redirects ...
Vijay Kumar Garg's user avatar
0 votes
1 answer
2k views

Set status code 301 or 303 in Spring RestTemplate and ResponseEntity

I've created a GET service to redirect to a webpage that uses POST. I'm trying to use restTemplate because with this I can send the body and header that request the service and I've achieved to get ...
Robcruzd's user avatar
1 vote
2 answers
4k views

Redirect to a URL with 404 status code in Java

How to redirect a http request to a specific URL with 404 status code. I am using Response.sendRedirect("/404userfriendlypage") The response code of requested URL is 301, instead i need that to be ...
user2390827's user avatar
1 vote
1 answer
954 views

Google HTTP Client Library for Java throws HttpResponseException: 301 Moved Permanently

I have a problem with Google HTTP Client Library for Java (1.22.0). This is my code String url = "http://gazetapraca.pl/ogl/2502758"; GenericUrl genericUrl = new GenericUrl(url); ApacheHttpTransport ...
Tomasz Molenda's user avatar
1 vote
4 answers
10k views

Android HttpURLConnection receives HTTP 301 response code

I'm trying to do a HTTP GET using the HttpURLConnection object in Android. UPDATE I tried connection to a different server. This is also hosted within Cloud 9 (c9.io) and also returns a json ...
Pablo K's user avatar
  • 410
0 votes
1 answer
31 views

I have Filter in Java that redirect fin but navigator don't cached imaged ( png and jpg but not gif)

i have a java server applications and nginx server with images , the idea is that images url in java Server redirect to nginx server with filter Java. i use filter java with 301 status and redirect ...
user avatar
1 vote
1 answer
688 views

Request by browser gets ok, but request by java got 301

I have a problem when I try to make a Java HTTP request to this URL: If I request it by browser, I receive a .csv, but when I try a getRequest or postRequest, I get a 301 code. Here is my code: ...
Tiago Oliveira's user avatar
7 votes
3 answers
137 views

BHSM-Servlet does not let browser cache username

i have a requirement where a value should not be cached in the server nor the browser as an cookie over domains and sessions. So i choosed to permanent-redirect to the value Servlet: @Override ...
Grim's user avatar
  • 1,629
0 votes
1 answer
1k views

Generating Http 301 Response Message

I'm trying to create a little web server and have be able to generate Http response messages 200, 301, and 404. I am able to get 200 and 404 to work, but I am having problems with 301. When I try to ...
P M's user avatar
  • 195
3 votes
4 answers
8k views

Spring + Tiles. How to return 301 redirect (instead of 302) in Controller

I am using the code like: @RequestMapping(value="/oldPath") public String doProductOld( @PathVariable(value = "oldProductId") Long oldProductId, Model model ) throws Exception { Product ...
Escander's user avatar
  • 256
1 vote
4 answers
1k views

Tuckey Filter - https redirect

I am trying to do a 301 redirect from http to https. When I use this rule I get an infinite loop redirecting to https://localhost/mypage: <rule> <name>https redirect</name> &...
user3673749's user avatar
0 votes
3 answers
2k views

Hybris + Spring URL Rewrite

At work I have to regularly work on a site that uses Tomcat, Hybris and (I think?) Spring. Although I'm slowly learning, I'm quite unfamiliar with all of these technologies. Is there a simple way to ...
Nick's user avatar
  • 357
8 votes
6 answers
47k views

301 Moved Permanently

I'm trying to get HTML by URL in Java. But 301 Moved Permanently is all that I've got. Another URLs work. What's wrong? This is my code: hh= new URL("http://hh.ru"); in = new BufferedReader( ...
Tony's user avatar
  • 3,775
3 votes
2 answers
2k views

In Struts2 how to do permanent redirects (status code 301) without having the parameter appearing in the URL

I have a Struts2 (version 2.2.3) web application. I am trying to redirect old links to new pages. I know I can do this via <action name="old-action" class="MVRActionClass"> <...
Chantz's user avatar
  • 5,943
6 votes
1 answer
7k views

301/302 Redirect not working in Android (work differently in different versions)

When using a URLConnection, the 301 redirect doesn't work, doesn't even show a Location header, using getHeaderFields(). It is a blank list, except in newer Android (I tested 4.1 and it worked). It ...
NoBugs's user avatar
  • 9,394

15 30 50 per page