This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes IllegalStateException: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "IllegalStateException:" Watch "IllegalStateException:" New topic


Katie Doody
Ranch Hand

Joined: Nov 03, 2006
Posts: 90
I am getting the above error but I am not sure if this is really the issue I am trying to fix. I have read all the posts related to this issue that I could find but had no luck. I have two buttons View Document and Attach Drawing (attach pdf).

Here are the steps that lead to my problem:

1) View Document
2) Press back button on browser
3) Attach Drawing
4) View Document
5) Press back button on browser

In step five I get a "Webpage has expired" error. I noticed that if i refresh the page that the same document is attached again.

Here is my code:

Attach Drawing Action:

Here is my View Document action code:

Here are the struts.xml entries:

I am wondering if my issue is with the interceptor and not really knowing how it is working.

Here is my server log:
12:40:14,423 INFO [STDOUT] 12:40:14,423 INFO [EASViewRequestA] Outside EASViewRequestA
12:40:14,829 INFO [STDOUT] 12:40:14,829 ERROR [RenderTagSupport] Error during rendering
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(
at org.apache.catalina.connector.ResponseFacade.getWriter(
at javax.servlet.ServletResponseWrapper.getWriter(
at org.apache.jasper.runtime.JspWriterImpl.initOut(
at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(
at org.apache.jasper.runtime.JspWriterImpl.flush(
at org.apache.jasper.runtime.JspRuntimeLibrary.include(
at org.apache.jasper.runtime.PageContextImpl.include(
at org.apache.tiles.jsp.context.JspUtil.doInclude(
at org.apache.tiles.jsp.taglib.InsertTemplateTag.render(
at org.apache.tiles.jsp.taglib.RenderTagSupport.execute(
at org.apache.tiles.jsp.taglib.RoleSecurityTagSupport.doEndTag(
at org.apache.tiles.jsp.taglib.ContainerTagSupport.doEndTag(
at org.apache.jsp.pages.requestFormPage_jsp._jspx_meth_tiles_insertTemplate_0(
at org.apache.jsp.pages.requestFormPage_jsp._jspService(
at org.apache.jasper.runtime.HttpJspBase.service(

Any help would be appreciated. Thanks.

[ August 25, 2008: Message edited by: Katie Doody ]

[ August 25, 2008: Message edited by: Katie Doody ]
[ August 25, 2008: Message edited by: Katie Doody ]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60774

Please be sure to use UBB code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.

You can go back and change your post to add code tags by clicking the .

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60774

If the back button is causing issues, it's usually a sign that you are leaving POSTS lying around. The best remedy is to adopt the so-called Post-Redirect-Get pattern. Perhaps this article, which describes web application structure patterns, might be helpful.
Katie Doody
Ranch Hand

Joined: Nov 03, 2006
Posts: 90
Thanks so much for your response.

In reading your article, I could see how this could be my issue if it was the last request that was being done over again but the funny thing is the last thing I do is view the document and then hit the back button. When I refresh it is the code that actually attaches the document that is called.
[ August 25, 2008: Message edited by: Katie Doody ]
Don't get me started about those stupid light bulbs.
subject: IllegalStateException:
Similar Threads
Populate the array
Struts2 Helloworld Problem
multiple file upload in Strut2
ModelDriver Interceptor + not getting my object
Struts 2 FileUpload working locally but not on server