1<?xml version="1.0" encoding="UTF-8"?> 2<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 4 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 5 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> 6 <filter> 7 <filter-name>webwork</filter-name> 8 <filter-class> 9 com.opensymphony.webwork.dispatcher.FilterDispatcher 10 </filter-class> 11 </filter> 12 13 <filter-mapping> 14 <filter-name>webwork</filter-name> 15 <url-pattern>*.action</url-pattern> 16 </filter-mapping> 17</web-app>
再url中输入的链接是*.action后缀名结尾,例如:http://localhost:8080/login/login.action如果把<url-patterm>*.action</url-pattern>改成<url-patterm>*.jspa</url-pattern>再没有配置webwork.properties的情况下输入http://localhost:8080/login/login*.jspa会报错,找不到相关的文件404错误,解决办法:配置webwork.properties文件,加入webwork.action.extension=jspa就可以解决自己想用的url后缀名http://localhost:8080/login/login*.jspa。