Jasper in jetty throws IllegalStateException on getOutputStream but not on Tomcat

I have a web application that is currently running under Tomcat 5.5.25. I am trying to port it to Jetty 6 in order to take advantage of the fast update time for jsp and user interface changes.

Since my JSP files are compatible with JSP 2.0, I run the pier under maven using the configuration suggested on the maven plugin website. This configuration loads the Apache jasper version 5.5.15 JSP compiler. (Also available in the maven 5.5.23 repository, but it has the same result.)

In the jetty area, my homepage, which is configured using fragments, explodes with an IllegalStateException in ServletResponseWrapperInclude.getOutputStream (). Obviously, under Tomcat this does not.

I'm struggling to understand that this applies to our stoves and includes something that will make jaspers complain about the pier, not at Tomcat.

+3
source share
2 answers

This may not be the answer, but we found that this error occurs when Tiles contains an empty tile.

By going through our JSP workshops and removing links to empty tiles, we fix this problem.

+1
source

Wow - a glorious find! Another solution that I just stumbled upon is to determine that the fragment includes an empty string, and not as an empty / null definition.

In other words, if I defined the fragment as follows, I will throw the IllegalStateException you described:

<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>

, , , :

<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>

, , !

0

Source: https://habr.com/ru/post/1704168/


All Articles