Struts2环境配置

2014-11-23 22:21:47 · 作者: · 浏览: 0
1、导入jar包
\

2、拷贝修改配置文件struts.xml,web.xml 将struts.xml文件拷贝到src目录下,改为如下配置 "1.0" encoding = "UTF-8" >
< struts> "struts.devMode" value= "true" /> "struts.action.extension" value = "action" /> "struts.ui.theme" value= "simple" /> "default" namespace = "/" extends= "struts-default">


将web.xml文件配置成如下形式 "1.0" encoding = "UTF-8" > < web-app version= "2.5" xmlns = "http://java.sun.com/xml/ns/javaee" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" > < display-name> < filter> < filter-name> struts2 < filter-class> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
< filter-mapping> < filter-name> struts2 < url-pattern> /* < welcome-file-list> < welcome-file> index. jsp
ps:xml自动提示设置: window ==> preferences ==> 搜索xml ==> xml catalog ==> key type改为URI ==> 选择dtd文件路径 ==>复制key为dtd文件名