我有 /WEB-INF/jsp/info/1.jsp 映射到 URI /info/1:
<servlet>
<servlet-name>/info/1</servlet-name>
<jsp-file>/WEB-INF/jsp/info/1.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>/info/1</servlet-name>
<url-pattern>/info/1</url-pattern>
</servlet-mapping>
使用 apache tomcat 中的 jspc ant 任务预编译 JSP 后,以下行添加到 web.xml:
<servlet>
<servlet-name>org.apache.jsp.WEB_002dINF.jsp.info._1_jsp</servlet-name>
<servlet-class>org.apache.jsp.WEB_002dINF.jsp.info._1_jsp</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>org.apache.jsp.WEB_002dINF.jsp.info._1_jsp</servlet-name>
<url-pattern>/WEB-INF/jsp/info/1.jsp</url-pattern>
</servlet-mapping>
然后当我导航到 /info/1 时,tomcat 再次编译 JSP。我该如何纠正这种情况?