strtus常用的一些配置

处理中文乱码问题

<constant name="struts.i18n.encoding" value="UTF-8"></constant>

filter中的配置
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>


struts.xml文件中头的配置
<!DOCTYPEstrutsPUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">




maven支持中pom.xml文件的配置


< dependency >
< groupId > mysql </ groupId >
< artifactId > mysql-connector-java </ artifactId >
< version > 5.1.26 </ version >
</ dependency >
< dependency >
< groupId > org.apache.struts </ groupId >
< artifactId > struts2-core </ artifactId >j_0003.gif
< version > 2.3.15.3 </ version >
</ dependency >
< dependency >
< groupId > net.sf.json-lib </ groupId >
< artifactId > json-lib </ artifactId >
< version > 2.4 </ version >
< classifier > jdk15 </ classifier >
</ dependency >


你可能感兴趣的:(filter,中文,action)