On Fri, 24 Jan 2003, Mike Jackson wrote:

>
> I've had problems with something in a similar way, I have a login page in
> which if the login is successfull it will while send back a redirect to the
> client.  That redirect is supposed to go to the menu page for the webapp,
> but because the jsp is not only sending the header back, but some content
> (several blank lines) I have found that some versions on IE will become
> confused and ignore the redirect.  My solution was to move the login into a
> servlet and then to have the servlet send the redirect without sending any
> content (it's better practice to do that anyway).
>

If you're sending a redirect from a servlet (or a filter) via Java code,
you must do a "return" statement afterwards to avoid sending the rest of
the content that would otherwise be sent:

  response.sendRedirect(...);
  return;

Same thing goes if you are (shudder) doing the redirect from within a JSP
page:

  <%
    response.sendRedirect(...);
    return;
  %>

> So, in the end, I'm not clear on how filters work exactly (haven't needed to
> use them yet), but when you're using the header type redirect you need to
> make sure that you're not going to send back anything other than the
> redirect.  If you do send something most clients will work properly, but
> some won't.
>

> --mikej

Craig



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to