• 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

Interesting findings with sendRedirect

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Was experimenting with response.sendRedirect(), while reading the HFSJ, for sometime. Stuck with following observations.

1. When the server sends back the response (that resource has been moved) the response status is 302 and not 301 as in HFSJ. I understand that the browser behaves in same way for both of them. Want to know the exact status message, any help ?

2. When i used a complete URL (i.e. http://google.com), with sendRedirect(), the browser DID made a second request to the google. However, when i used relative URL (starting with/without forward slash) there is no second request. In one sentence, the container seems to understnad that the new URL is from itself and sent back the new content (instead of asking the client to make a second request). I tried to find out if this is specified in spec but didnt find any. Is this vendor specific ?

I am using tomcat 5.5.

Awaiting your reply...

Thanks and Seasons greetings,
- Ari
[ December 29, 2008: Message edited by: Ari Jeremy ]
 
Get me the mayor's office! I need to tell her about this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic