gstackoverflow
gstackoverflow

Reputation: 37034

jsp include doesn't work for jspf files under tomcat 8 but works under the jetty

I have the following jsp:

...
<jsp:include page="../imageMenu.jspf"/>
...

When I open following jsp when application run under the tomcat 8 I see that my include replaces with empty string.

When I run application under the jetty - it renders good.

As I undestand the problem related with format of included file because I don't see problem with jsp files included when I run application under the tomcat.

Upvotes: 2

Views: 1049

Answers (2)

gstackoverflow
gstackoverflow

Reputation: 37034

Working after adding

<url-pattern>*.jspf</url-pattern>

to web.xml

result:

<servlet-mapping>
        <servlet-name>servletname</servlet-name>
        <url-pattern>*.jsp</url-pattern>
        <url-pattern>*.jspx</url-pattern>
        <url-pattern>*.jspf</url-pattern>
    </servlet-mapping>

Upvotes: 1

Can you try using full path.

<jsp:include page="/WEB-INF/JSPs/repo1/repo2/imageMenu.jspf"></jsp:include>

Upvotes: 0

Related Questions