jsp include不适用于tomcat 8下的jspf文件,但在码头上工作 [英] jsp include doesn't work for jspf files under tomcat 8 but works under the jetty

查看:285
本文介绍了jsp include不适用于tomcat 8下的jspf文件,但在码头上工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下jsp:

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

当在tomcat 8下运行应用程序时,当我在jsp后面打开时,我看到我的include替换为空字符串.

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.

由于无法理解与包含文件格式有关的问题,因为在tomcat下运行应用程序时看不到包含jsp文件的问题.

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.

推荐答案

添加后工作

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

到web.xml

结果:

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

这篇关于jsp include不适用于tomcat 8下的jspf文件,但在码头上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆