Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with response.sendRedirect

 
tushar borole
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to redirct one url from my action class, but getting some server error like 403- forbiddon error. n this case I can see the required url posted in the address bar,but getting 403-forbiddon error. If I copied the same url and hit in the another browser then, it is working perfect.
Can anybody help me to resolve this problem or please give me some pointers to resolve this.

URL is in the following format

http://host ort/do/login¶m1=val1¶m2=val2

Thanks,
Tushar
 
yashpal waghmare
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tushar,

I think you have to do like this,

String url ="http://www.google.com";

response.sendRedirect(url);

//try out these 2 lines.
 
tushar borole
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Yashpal,
The url you hav mentioned is working fine. But I need to redirect to the perticular host and specific port where my another application is running.

So he url must be http://host:<port_no>/do/doLogin/<param lists values>

Do you have any idea on the same. I guess The respose is not commiting properly or the session might have some set of values..not sure.

Thanks,
Tushar
 
tushar borole
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by tushar borole:
Hi,
I am trying to redirct one url from my action class, but getting some server error like 403- forbiddon error. n this case I can see the required url posted in the address bar,but getting 403-forbiddon error. If I copied the same url and hit in the another browser then, it is working perfect.
Can anybody help me to resolve this problem or please give me some pointers to resolve this.

URL is in the following format

http://host ort/do/login¶m1=val1¶m2=val2

Thanks,
Tushar
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by tushar borole:
If I copied the same url and hit in the another browser then, it is working perfect.


1. another browser means which one?

2. whether the applications running in same webserver?

3.can you post your code for redirecting?(if you dont mind)
 
tushar borole
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. another browser means which one?
If I copied the redirect url and enter in another window, then it is responding correctly whereas while response.sendRedirect() it is giving 403-forbidon error.

2. whether the applications running in same webserver?
They are running on different servers i.e. resins running on different machines.

3.can you post your code for redirecting?(if you dont mind)

Refer the below code:

String redirect = (String)request.getAttribute(REDIRECT_URL);
response.sendRedirect(redirect);

Here response is getting redirected properly to required url but browser showing 403-forbidon error. Now If I re-entered the same url in same browser window, it will respond properly.
 
tushar borole
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do anyone have pointers for the above problem?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic