You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Brandon Cruz <bc...@norvax.com> on 2001/05/09 23:24:25 UTC

problem with response.sendRedirect()

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()

Posted by Brandon Cruz <bc...@norvax.com>.
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:sponks@mozcom.com]
Sent: Wednesday, May 09, 2001 4:40 PM
To: tomcat-user@jakarta.apache.org
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()

Posted by "Noel E. Lecaros" <sp...@mozcom.com>.
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