Search code examples
jsptomcattomcat9

Tomcat 9.0.67 <%@ include dont work in some cases


We update our system to the newest tomcat 9-Version now some jsp throws exception like:

Caused by: org.apache.jasper.JasperException: /WEB-INF/views/manager/content/content.jsp (Line: [653], Column: [5]) File [include/editConten.jsp] not found

At line 653 we have the following code:

<%@ include file="include/content.jsp"%>

The content-jsp exists and if I change to:

<jsp:include page="include/content.jsp"/>

It works but can't access the models.

Other jsps with the same include works fine, also with Tomcat 9.0.64 all worked fine.

Somebody knows any changes to fix this or is this a bug of the newest tomcat 9?

Note: This seems to happen if you have multiple relative includes.


Solution

  • I found a solution, this happens only if you use multiple relative includes in the same jsp. If you link all absolute it works fine. It seems that the system goes relative from the relative include not from the main file.

    So if anybody has the same problem and multiple includes link all absolute not relative

    Edit: Is a bug of tomcat and fixed with the next version