Hello,

 

I've seen a few posts on this subject, through this and other resources,
but I haven't seen any appealing workarounds.  I'd like to try to bring
all the relevant information from these posts together and then ask for
help in identifying a viable workaround.  I apologize in advance if this
issue is well known and understood and I just missed the best resources
on the subject.

 

Goals:

1)       To build a Struts application where _every_ request to the
application goes through a Struts action that collects and packages data
then forwards (using Struts ActionForward's) to a JSP.

2)       To be able to include one or more Struts actions in any given
JSP (ie: <c:import url="/someAction.do" />).

 

Behavior when implementing these goals:

1)       Usually, when executing a single include of a Struts action on
a JSP, everything works fine though sometimes there are problems (as
listed below).

2)       When including more than one Struts action on a JSP I get an
IllegalStateException - Response has already been committed.

3)       Sometimes, when a JSP only includes one Struts action, the
first x bytes of the response will be missing when it is returned
(without exception) to the client.

 

Relevant issues (correct me where I'm wrong):

1)       Including (<jsp:include>, <c:import>, etc.) a JSP/Servlet on a
JSP sometimes (always?) causes the response to be committed because
includes use RequestDispatcher.include() which in turn commits the
response.

2)       Forwarding a request using an ActionForward from a Struts
action to a JSP can not be done when a response has been committed.

3)       Increasing the response buffer size has no effect on these
issues.

4)       Using the include directive (<%@ include file="filename" %>)
won't work because that includes source a translation time.

5)       It has been reported that using <tiles:insert> does not
(fully/always?) resolve the problematic behavior.

6)       Using absolute URLs with <c:import> prevents the response from
being committed because the context of the request is assumed to be
independent.  The visibility of an authenticated, populated session can
be affected by passing the jsessionid in on the URL.  This seems to be
the only viable workaround though I haven't tested it thoroughly yet.

 

Reference:

http://www.mail-archive.com/[EMAIL PROTECTED]/msg13284.html

http://www.jguru.com/faq/view.jsp?EID=501393

http://www.mail-archive.com/[EMAIL PROTECTED]/msg05711.htm
l

http://www.mail-archive.com/[EMAIL PROTECTED]/msg15194.html

http://forum.java.sun.com/thread.jsp?thread=484731&forum=45&message=2266
277

http://www.mail-archive.com/[EMAIL PROTECTED]/msg15189.html

http://jguru.com/forums/view.jsp?EID=1204797

http://forum.java.sun.com/thread.jsp?thread=461644&forum=45&message=2115
900

http://www.mail-archive.com/[EMAIL PROTECTED]/msg18018.html

http://www.mail-archive.com/[EMAIL PROTECTED]/msg74816.html

http://www.mail-archive.com/[EMAIL PROTECTED]/msg29073.html

 

My setup:

-          Oracle AS 10g (OC4J) app server

-          Struts 1.1

-          JSTL 1.0.6

 

Is there any clean way to meet the two goals listed above without error?

 

Thanks,

Jeff

 

 

 





Reply via email to