wood burning stoves*
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
JavaRanch » Java Forums » Java » Servlets
Bookmark "IllegalStateException:" Watch "IllegalStateException:" New topic
Author

IllegalStateException:

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(Response.java:599)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:195)
at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:111)
at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:124)
at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:117)
at org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:172)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:954)
at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:614)
at org.apache.tiles.jsp.context.JspUtil.doInclude(JspUtil.java:93)
at org.apache.tiles.jsp.taglib.InsertTemplateTag.render(InsertTemplateTag.java:68)
at org.apache.tiles.jsp.taglib.RenderTagSupport.execute(RenderTagSupport.java:172)
at org.apache.tiles.jsp.taglib.RoleSecurityTagSupport.doEndTag(RoleSecurityTagSupport.java:76)
at org.apache.tiles.jsp.taglib.ContainerTagSupport.doEndTag(ContainerTagSupport.java:82)
at org.apache.jsp.pages.requestFormPage_jsp._jspx_meth_tiles_insertTemplate_0(requestFormPage_jsp.java:134)
at org.apache.jsp.pages.requestFormPage_jsp._jspService(requestFormPage_jsp.java:61)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)


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
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

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
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
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