Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

redirecting page in JSP

 
Arunagiri, Shanmugham
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to redirect from a jsp page to another url after checking for the parameter from request object.
When i use the command response.sendRedirect("http://..."), the next page displays,
the document has been moved to http://.... instead of showing that page.
What is the reason for this?
Arun
 
Bharatesh H Kakamari
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you hv mentioned is not very clear.
Try using <jsp:forward> tag.
Or post your code here ... for better understanding of problem.
 
Arunagiri, Shanmugham
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bharatesh,
This is my code
<% if((request.getParameter("submit")).equals("Modify")){
response.sendRedirect("http://www.seeconsulting.com/jsp/CompDisp.jsp"}%>
Arun
 
Bharatesh H Kakamari
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just modified your code as follows :

Basically i just modified the method name.
I am not sure if this was what your problem ?
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Heh
What I think you may be running into is the following:
If the 307 status code [Temporary Redirect -- PdH] is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued. -- RFC 2616, HTTP 1.1 protocol specification, section 10.3.8.
From the looks of the code snippet you gave, the request might have been a POST. In that case the fix may be as simple as either changing your form to use the GET method, or replace the redirect by a forward (if possible).
Not entirely sure, but...
have fun,
- Peter

[This message has been edited by Peter den Haan (edited March 07, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic