码迷,mamicode.com
首页 > 其他好文 > 详细

Struts2 环境搭建

时间:2017-08-02 22:12:51      阅读:113      评论:0      收藏:0      [点我收藏+]

标签:str   efi   xsd   struts2   ant   lte   png   doctype   constant   

1.引入相关struts2 jar包

技术分享

2.web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
  <display-name>Struts2Demo</display-name>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>


  <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>
</web-app>

3.struts.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
        <constant name="struts.i18n.encoding" value="utf-8"></constant>
    <package name="student" extends="struts-default">
        <action name="listStudent" class="com.epoint.action.ListStudent" method="toList">
            <result name="toList">/index.jsp</result>
        </action>    
        ......
    </package>
</struts>    

 

Struts2 环境搭建

标签:str   efi   xsd   struts2   ant   lte   png   doctype   constant   

原文地址:http://www.cnblogs.com/circlesmart/p/7276854.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!