Re: problem with response.sendRedirect()
Hi, Brandon Can you tell us the OS, tomcat and apache versions, sample output and perhaps a snippet of the code? I can't promise anything but this looks like an interesting problem. Regards, Noel Lecaros Brandon Cruz wrote: I have a jsp that does a simple response.sendRedirect to another page on the site when a user logs out. For develoopment, we use tomcat standalone and there is no problem executing that method. On production, we have apache as the webserver and it seems to choke when executing that method. There are other parts on the site that do a redirect with no problem, it is only this one (which happens to be when a user logs out and a connection to the database is closed). Sometimes it shows all the source code from the jsp to the browser and some apache headers as well. Anyone ever seen anything like this? Brandon Cruz
RE: problem with response.sendRedirect()
I am using linux, tomcat v3.2.1 Apache v1.3.14 and my code is very simple... if (request.getParameter(Submit).equals(logout)){ sessionBean.setLogin(false); sessionBean.closeConnection(); response.sendRedirect(thanks.jsp); //to say thank you after logout } I was redirecting to thanks.html but switched to .jsp thinking it may help. It does help, none of the code prints to the screen (so far), but now it ignores the stylesheet for the page (thanks.jsp). For some reason, this does not happen if I use tomcat standalone. I am getting this message in the tomcat.log file... 2001-05-09 05:08:05 - Ctx( www.mysite.com ): Handler tomcat.redirectHandler(null/null) tomcat.redirectHandler I do a redirect to a page when I log in which works fine like this... if (sessionBean.getLogin() == true) response.sendRedirect(/); // to go to the home page Brandon -Original Message- From: Noel E. Lecaros [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 09, 2001 4:40 PM To: [EMAIL PROTECTED] Subject: Re: problem with response.sendRedirect() Hi, Brandon Can you tell us the OS, tomcat and apache versions, sample output and perhaps a snippet of the code? I can't promise anything but this looks like an interesting problem. Regards, Noel Lecaros Brandon Cruz wrote: I have a jsp that does a simple response.sendRedirect to another page on the site when a user logs out. For develoopment, we use tomcat standalone and there is no problem executing that method. On production, we have apache as the webserver and it seems to choke when executing that method. There are other parts on the site that do a redirect with no problem, it is only this one (which happens to be when a user logs out and a connection to the database is closed). Sometimes it shows all the source code from the jsp to the browser and some apache headers as well. Anyone ever seen anything like this? Brandon Cruz
RE: problem with response.sendRedirect()
I try to redirect users who try to access page on my site and who have not enter username + passord. I have a litle jsp : % User tUser = (User)session.getAttribute("user"); if ( tUser == null) { response.sendRedirect("http://localhost:8080/"); } % which call confirmLogin.jsp and on the top of each page i have a : %@ include file="confirmLogin.jsp" % try adding return; after your sendRedirect(...) --- Michael Wentzel Software Developer Software As We Think - http://www.aswethink.com
Re: Problem with response.sendRedirect
It really sounds like a browser problem. There's not much you can do to the JSP other than to try changing the redirection to/from a relative/absolute URL (if possible) to see if that makes a difference with your browser. The next obvious suggestion is to verify the problem on a different browser. Original Message On 2/4/01, 6:26:46 PM, Melissa Matthews [EMAIL PROTECTED] wrote regarding Problem with response.sendRedirect: I am using the sendRedirect method from a JSP page to send a user to another JSP page after logging in. While it does redirect to the correct page, the fonts, images etc. are not right until I hit the refresh. If I go to the exact same page in my browser, it's fine. Is the redirect doing something that loses or changes the paths for files that are included? Melissa Matthews Product Development Manager Packexpo.com Phone 703.205.9256 Fax 703.205.2961 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]