struts2 2.5.2web.xml和struts.xmll配置

来源:互联网 发布:uml类图用什么软件 编辑:程序博客网 时间:2024/06/04 01:26
web.xml
<?xml version="1.0" encoding="UTF-8"?><web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">  <display-name>HelloWorld</display-name>    <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>/*</url-pattern>  </filter-mapping>         <welcome-file-list>    <welcome-file>index.jsp</welcome-file>  </welcome-file-list>    </web-app>
struts.xml
<pre name="code" class="html"><?xml version="1.0" encoding="UTF-8"?><!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN" "http://struts.apache.org/dtds/struts-2.5.dtd" ><struts>   <package name="default" namespace="/" extends="struts-default">              <action name="helloworld" class="com.imooc.action.HelloWorldAction">           <result>/result.jsp</result>       </action>          </package>        </struts>



0 0