<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/com.action/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>myServlet</servlet-name>
<servlet-class>com.function.addGoods</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>myServlet</servlet-name>
<url-pattern>/function/addGoods</url-pattern>
</servlet-mapping>
转载于:https://www.cnblogs.com/zhaocundang/p/9271510.html