Announcement Announcement Module
Collapse
No announcement yet.
IllegalStateException using Tiles Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • IllegalStateException using Tiles

    I'm getting an IllegalStateException that I'd like to demonstrate by using the tiles-example included with spring-framework-1.2.6.

    1) Create an error page in web.xml
    Code:
    <error-page>
    	<exception-type>javax.servlet.jsp.JspException</exception-type>
    	<location>/exception.jsp</location>
    </error-page>
    2) Create the exception page at /exception.jsp
    3) Modify /WEB-INF/jsp/contact.jsp so that it contains the following:
    Code:
    <%
    	boolean throwIt = true;
    	if (throwIt) {
    		throw new javax.servlet.jsp.JspException("test");
    	}
    %>
    4) build and deploy
    5) test the app by navigating to the contact menu item.

    - Examine your server log and you will see:
    Code:
    java.lang.IllegalStateException
     at org.apache.coyote.Response.reset(Response.java:296)
    which of course prevents me from getting to the configured error page.

    Could anyone recommend the best way to handle exceptions in views when using Tiles.

  • #2
    Resolution

    I changed code in org.apache.struts.tiles.TilesUtilImpl.doInclude(St ring uri, PageContext pageContext)

    from
    pageContext.include(uri);
    to
    pageContext.include(uri, false);
    and now am getting the expected behavior.

    Comment

    Working...
    X