如何运行后缀不是jsp的jsp文件?

如何运行后缀不是jsp的jsp文件?

需要在你的web.xml中定义如下:

    <servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>fork</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>xpoweredBy</param-name>
            <param-value>false</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>jsp</servlet-name>
        <url-pattern>*.jsm</url-pattern>
    </servlet-mapping>

你可能感兴趣的:(如何运行后缀不是jsp的jsp文件?)