Weird scenes with response.sendRedirect().
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ben_Carterette
Posted On:   Sunday, April 29, 2001 09:17 AM

I am attempting to upgrade my web server to Tomcat 3.2 with Apache 1.3, but some of the pages built under Apache 1.3 with JServ (using GNUJSP 1.0) are not working. All of these pages use session tracking. What's happening is this: I have an index.jsp and a login.jsp. The user connects to index.jsp, then clicks a link to login.jsp. Login.jsp has a form whose action is itself, i.e. action="login.jsp". Login.jsp checks the user against a database, sets some session stuff, and then does a response.sendRedirect("index.jsp"). This all worked fine before I installed Tomcat. Now, after I hit the Login button, the login page stays on the screen, the response headers are printed underneath it, and the index.jsp underneath that. What do I   More>>

I am attempting to upgrade my web server to Tomcat 3.2 with Apache 1.3, but some of the pages built under Apache 1.3 with JServ (using GNUJSP 1.0) are not working. All of these pages use session tracking. What's happening is this: I have an index.jsp and a login.jsp. The user connects to index.jsp, then clicks a link to login.jsp. Login.jsp has a form whose action is itself, i.e. action="login.jsp". Login.jsp checks the user against a database, sets some session stuff, and then does a response.sendRedirect("index.jsp"). This all worked fine before I installed Tomcat. Now, after I hit the Login button, the login page stays on the screen, the response headers are printed underneath it, and the index.jsp underneath that.

What do I do?

thanks,
ben.    <<Less

Re: Weird scenes with response.sendRedirect().

Posted By:   AlessandroA_Garbagnati  
Posted On:   Sunday, April 29, 2001 09:35 AM

Hi,

Before using sendRedirect() you have to clean the response buffer and, most important, right after the sendRedirect() you need to add a return.
About | Sitemap | Contact