当前位置: 代码迷 >> Web前端 >> struts2环境的筹建
  详细解决方案

struts2环境的筹建

热度:97   发布时间:2012-10-29 10:03:53.0
struts2环境的搭建
第一步:将需要的jar包导入web-inf下面的lib目录下
struts2-core-xxx.jar
xwork-core-xxx.jar
common-logging-xxx.jar
common-io-xxx.jar
common--fileupload-xxx.jar
javassist-xxx.jar

第二步:配置web.xml文件
在web.xml文件中加入
	
<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>/*</url-pattern>
</filter-mapping>

第三步:加入struts.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
</struts>
  相关解决方案