• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can sendredirect() method take relative urls?

 
Rajat Singla
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,
can sendRedirect() method of HttpServletResponse interface take relative url's. according to earlier specs i think it was not allowed.
pl clarify.
regs
rajat
 
Sergey Opanasets
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Extract from Servlet 2.3 spec
"...The sendRedirect method will set the appropriate headers and content body to redirect the client to a different URL.It is legal to call this method with a relative URL path, however the underlying container must translate the relative path to a fully qualified URL for transmission back to the client. If a partial URL is given and, for whatever reason, cannot be converted into a valid URL, then this method must throw an IllegalArgumentException...."
see section SRV.5.3
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic