aspose file tools*
The moose likes Servlets and the fly likes Getting problem while redirecting the URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Getting problem while redirecting the URL" Watch "Getting problem while redirecting the URL" New topic
Author

Getting problem while redirecting the URL

tushar borole
Greenhorn

Joined: Oct 13, 2008
Posts: 12
Hi,

I am using response.sendRedirect() to redirect the URL.
The URL format is as below

http://<host ort>/context?<param1=val1>&<param2=val2>&<param3=val3>

code is as below

e.g.
redirectURL = http://<host ort>/context<param1=val1>&<param2=val2>&<param3=val3>
[Note : runtime host, port, all params and values are getting populated correctly.]

response.sendRedirect(redirectURL);

Now , I can see the generated url in address bar with 403-forbidon error.

But if I re-entered the same url, it will work properly. It means I need to re-enter the url, then it will show the result.

Do any one have pointers to resolve this issue?

As per my analysis, if the redirect url dosen't have any context path then it is working fine. e.g. www.google.com.

Thanks,
Tushar
Pankaj Misra
Greenhorn

Joined: Dec 28, 2008
Posts: 11
Could you please post your fully constructed URL, it will help debug the root cause.
tushar borole
Greenhorn

Joined: Oct 13, 2008
Posts: 12
Hi ,

The constructed url is

http://lnx1.domainname:20080/example/dologin?account=test1&password=test2&locale=en-US

The above url is not working when I am passing it to sendRedirect().

But if I re-enter the same url in same window or another window it is perfectly working.

Do you have any pointers to resolve this.
RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
Did you tried using the method encodeRedirectURL and return type of it into sendRedirect()??


If you want something you never had do something which you had never done
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting problem while redirecting the URL