tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Troy Echols <tech...@lucent.com>
Subject Re: Problems with JSP include and commitment
Date Thu, 15 Jun 2000 18:01:49 GMT
One other addition:

In the scenario mentioned previously, user-agent_appropriate.jsp is re-entered
from each of the interaction_specific.jsp templates (which are forms).

Troy Echols wrote:

> I've been struggling with this problem for a couple of days.  I
> understand that there are issues with jsp:forward when the response has
> already been committed (i.e., headers have already been written?).  What
> are the restrictions on jsp:include?  In practice, what does it mean to
> commit the response.  I don't explicitly set any headers before I
> perform my jsp:include, but I keep getting the error
> "java.lang.IllegalStateException: Response has already been committed"
> at the point where my include is done.  Under what conditions might I be
> "committing the response" without knowing it.  I don't have any problems
> with commitment in general, but in this case I don't think I want it.
>
> Any help would be appreciated!
>
> Troy
>
> The scenario and an example follow:
> o main.jsp determines user-agent and forwards to
> user-agent_appropriate.jsp
> o user-agent_appropriate.jsp processes request and interacts with a bean
> that contains service logic.  Based on direction from bean,
> user-agent_appropriate.jsp forwards to interaction_specific.jsp which is
> a template for a particular class of interaction with user.  I
> originally was using jsp:include here, but it didn't work for the same
> reason.   In this case, jsp:forward was a suitable substitute.
> o interaction_specific.jsp template may jsp:include one or more
> templates for dynamic sub-interactions that may need to be done.  This
> is where I'm getting the error and jsp:forward is not a suitable
> substitute in this case.
>
> <html>
> <head> <title> Login Screen </title> </head>
> <body>
> <form name="getPassword" method="post"
> action="html/user-agent_appropriate.jsp">
> <center>
>
> <%@ page language="java" import="java.util.*" autoFlush="false"%>
>
> <jsp:useBean id="manager" scope="session"
> class="myapp.InteractionManager"/>
>
> <%Iterator it = manager.getQueuedNotificationTaskIterator();
>   while (it.hasNext()) {
>     String message = (String) it.next();
>     String template = manager.getTaskSpecDescription(message); %>
> <jsp:include page="<%= template %>" flush="true"/>
> <br>
> <%  } %>
>
> <br>
> Login:  <input name="currentUserID" type="text">
> <br>
> Password:  <input name="password" type="password">
> <br>
> <input type="submit" value="Login Now!">
> <br>
> <input type="submit" value="terminateSession" name="terminateSession">
> <input type="submit" value="assistancePlease" name="assistancePlease">
> </center>
> </form>
> </html>
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org


Mime
View raw message