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? --somePage.jsp-- <s:action name="someAction" executeResult="true" ignoreContextParams="false" /> --struts.xml-- <action name="someAction" class="com.dev.MyAction" method="execute"> <result>/page.jsp</result> </action> --MyAction.java-- public String execute() { System.out.println("response.isCommitted() = " + response.isCommitted()); //this prints true } Thanks, David --------------------------------------------------------------------- This message, together with any attachments, is intended only for the use of the individual or entity to which it is addressed. It may contain information that is confidential and prohibited from disclosure. If you are not the intended recipient, you are hereby notified that any dissemination or copying of this message or any attachment is strictly prohibited. If you have received this message in error, please notify the original sender immediately by telephone or by return e-mail and delete this message, along with any attachments, from your computer. Thank you. --------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]