views:

350

answers:

2

I have a web application that's currently running under Tomcat 5.5.25. I'm attempting to port it to Jetty 6 to take advantage of the rapid refresh time for jsp and UI changes especially.

Since my JSP files are JSP 2.0 compliant, I'm running jetty under maven using the configuration suggested on the maven jetty plugin web site. This config loads apache's jasper JSP compiler version 5.5.15. (Also available in the maven respository is 5.5.23, but it has the same result.)

Under jetty, my home page, which is configured using tiles, blows up with IllegalStateException in ServletResponseWrapperInclude.getOutputStream(). Obviously under Tomcat it doesn't do this.

I'm struggling to understand what it is about our tiles and includes that would cause jasper to complain in jetty and not in Tomcat.

A: 

This may not be much of an answer, but we discovered that this error happens when Tiles includes an empty tile.

By going through our master tile JSPs and removing references to empty tiles, we make this problem go away.

Mojo
Please mark this answer accepted, so that this topic won't get poked up everytime because it doesn't contain any accepted answer :)
BalusC
A: 

Wow -- nice find! Another solution I just stumbled upon is to define the tile include as an empty string rather than as an empty/null definition.

In other words, if I defined a tile as follows, I hit the IllegalStateException you describe:

<definition name="login" extends="main.layout">
    <put name="title" value="Login" type="definition" />
    <put name="headinclude" value="" type="definition" />
    <put name="body" value="/WEB-INF/tiles/login.jsp" type="page" />
</definition>

If I, on the other hand, define the tile as follows, the exception goes away:

<definition name="login" extends="main.layout">
    <put name="title" value="Login" type="definition" />
    <put name="headinclude" value="" type="string" />
    <put name="body" value="/WEB-INF/tiles/login.jsp" type="page" />
</definition>

Weird bug, weird solution, but it works for me!

delfuego