[EMAIL PROTECTED] wrote:
I have a JSP that uses an ActionTag <s:action> to call a Struts 2 action
class directly from the JSP. But in the action class, the HTTP response
has already been committed. This makes it impossible for me to set cookies
from my action class.
I tested this by calling HttpServletResponse.isCommitted() is my execute()
method of my action class, and it returns true.
Is this a bug? Why is the response committed if the JSP hasn't finished
rendering?
Struts2 ActionInvocations are not designed to be nested, but the
s:action tag attempts to do this. It works most of the time, but not all
Results can be executed within another page, and not pages can handle
changes to the ActionContext by the nest invocation. The Action tag is
quite dodgy for this reason but there is currently no better alternative
in S2.
The problem is your case is with the Result that was executed. I
presume it has executed a ServletRedirectResult which assumes it can
commit the response (and does). TilesResult also has the same problem.
Try a different Result type.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]