• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting problem while redirecting the URL

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you please post your fully constructed URL, it will help debug the root cause.
 
tushar borole
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 528
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you tried using the method encodeRedirectURL and return type of it into sendRedirect()??
 
reply
    Bookmark Topic Watch Topic
  • New Topic