RE: problem with response.sendRedirect()

2001-05-09 Thread Brandon Cruz

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

2001-05-09 Thread Noel E. Lecaros

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




problem with response.sendRedirect()

2001-05-09 Thread Brandon Cruz

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

2001-04-09 Thread Michael Wentzel

> 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



problem with response.sendRedirect()

2001-04-09 Thread Patrick . Pierra

Hi,

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"
%>

but when I try to access  page directly whithout login I received a system
error : Internet explorer can not open the internet site
http://localhost:8080/myAdress

here is the trace :

java.net.SocketException: Connection reset by peer: socket write error
 java.lang.Throwable(java.lang.String)
 java.lang.Exception(java.lang.String)
 java.io.IOException(java.lang.String)
 java.net.SocketException(java.lang.String)
 void java.net.SocketOutputStream.socketWrite(byte [], int, int,
java.io.FileDescriptor)
 void java.net.SocketOutputStream.write(byte [], int, int)
 void org.apache.tomcat.service.http.HttpResponseAdapter.doWrite(byte
[], int, int)
 void org.apache.tomcat.core.BufferedServletOutputStream.doWrite(byte
[], int, int)
 void org.apache.tomcat.core.BufferedServletOutputStream.reallyFlush()
 void org.apache.tomcat.core.ResponseImpl.flushBuffer()
 void org.apache.tomcat.core.HttpServletResponseFacade.flushBuffer()
 void org.apache.jasper.runtime.JspWriterImpl.flush()
 void _0002fquery_0002ejspquery_jsp_4.
_jspService(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
 void
org.apache.jasper.runtime.HttpJspBase.service(javax.servlet.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse)
 void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
 void
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(javax.servlet.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse, boolean)
 void
org.apache.jasper.runtime.JspServlet.serviceJspFile(javax.servlet.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse, java.lang.String,
java.lang.Throwable, boolean)
 void
org.apache.jasper.runtime.JspServlet.service(javax.servlet.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse)
 void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
 void
org.apache.tomcat.core.ServletWrapper.handleRequest(org.apache.tomcat.core.Request,

org.apache.tomcat.core.Response)
 void
org.apache.tomcat.core.ContextManager.service(org.apache.tomcat.core.Request,

org.apache.tomcat.core.Response)
 void
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(org.apache.tomcat.service.TcpConnection,

java.lang.Object [])
 void org.apache.tomcat.service.TcpConnectionThread.run()
 void java.lang.Thread.run()

after that, when i refresh, the browser  come on the page where i am

someone could help me to understand ?

Patrick PIERRA




Re: Problem with response.sendRedirect

2001-02-04 Thread Chris Janicki

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]




Problem with response.sendRedirect

2001-02-04 Thread Melissa Matthews

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]