| Author |
sendRedirect problem
|
Hazel Sisson
Greenhorn
Joined: Feb 12, 2002
Posts: 17
|
|
Hello, what I am trying to do is redirect to a page using sendRedirect(). I am using this method so that the correct URL will be displayed in the address bar, as previously the servlet had changed it. This is the page sequence: login.jsp -> loginservlet.java -> redirect.jsp -> index.jsp In redirect.jsp I have put this code: The aim is for the page to redirect correctly while maintaining the session whether cookies are enabled or not, i.e. I need to encode the URL. Presently when redirect.jsp is reached the sequence stops and it doesn't redirect. This happens whether cookies are enabled or not. "Loading..." is displayed. Does anyone have any idea why it stops here? Thanks very much, Hazel
|
 |
Madhav Lakkapragada
Ranch Hand
Joined: Jun 03, 2000
Posts: 5040
|
|
"Loading..." is displayed. Does anyone have any idea why it stops here? If "Loading..." is displayed, that means your response is committed. Once response is committed, it possible that the app server throws an IllegalStateException. 1. Check your app server log. 2. Add a stmt "<%= response.isCommitted()%> before the redirect to find out if response is committed or not? 3. If you want to add something to the response, maybe you could do it in the other JSP itself, if possible. regds. - madhav
|
Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
|
 |
Hazel Sisson
Greenhorn
Joined: Feb 12, 2002
Posts: 17
|
|
Thanks very much, I will give it a go! Hazel
|
 |
 |
|
|
subject: sendRedirect problem
|
|
|