1. 編輯 x:\Tomcat\conf\context.xml 設定檔, 找到 Context 區間, 加入紅字部分
<!-- The contents of this file will be loaded for each web application -->
<Context
privileged="true">
<!-- Default set of monitored resources --> <WatchedResource>WEB-INF/web.xml</WatchedResource>
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!-- <Manager pathname="" /> --></Context>
2.若需要 Tomcat 每個 App 皆能執行 Servlet 則再進行如下修改
開啟編輯 web.xml的 invoker 設定
尋找以下兩區間 invoker設定 將 <! -> mark 拿掉後,存檔
<!--
<servlet>
<servlet-name>invoker</servlet-name>
<servlet-class> org.apache.catalina.servlets.InvokerServlet </servlet-class>
<init-param> <param-name>debug</param-name>
<param-value>0</param-value> </init-param>
<load-on-startup>2</load-on-startup>
</servlet>
-->
<!-- The mapping for the deprecated invoker servlet -->
<!--
<servlet-mapping><servlet-name>invoker</servlet-name><url-pattern>/servlet/*</url-pattern>
</servlet-mapping>-
->
<!-- The mapping for the JSP servlet -->