tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Farley <ch...@northernbrewer.com>
Subject Re: Exception thrown when Forwarding
Date Fri, 13 Oct 2000 05:01:31 GMT
On Thu, 12 Oct 2000, Anand Prasad wrote:

> When the user directly wants to enter the url without logging, I would like 
> to redirect him to login page.
> 
> Here is code snippet.
> //
> <% if((String)session.getValue("loginId")==null){ %>
>       <jsp:forward page="/login.htm" />
> <% } %>
> 
> It throws up an exception in apache and tomcat.

It is impossible to redirect to a different page if the output buffer has
been flushed (sent to the HTTP server). If your conditional doesn't appear
until you've written a lot of output, you could try increasing the size of
your output buffer, for example: <%@ page buffer="12kb" %>


Mime
View raw message