安装Struts2框架
来源:互联网 发布:ubuntu 安装命令 编辑:程序博客网 时间:2024/06/07 12:54
安装Struts2框架
1、打开http://struts.apache.org/网站,点击右上角的struts2,在进入的页面点击Download Now,下载Full Distribution(完整版),并解压。
2、复制lib目录下的commons-logging-1.0.4.jar,freemarker-2.3.13.jar,ognl-2.6.11.jar,struts2-core-2.1.6.jar,xwork-2.1.2.jar到/WEB-INF/lib目录下(其他jar文件请根据需要复制)。
3、在/WEB-INF/下的web.xml中添加
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
配置stutrs2的核心filter
4、在src目录中新建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>
<package name="struts2" extends="struts-default"> <!--必须有package-->
<action name="login" class="com.test.action.LoginAction">
<result name="input">/login2.jsp</result>
<result name="success">/result.jsp</result>
</action>
</package>
</struts>
- 安装Struts2框架
- 如何下载和安装Struts2框架
- 如何下载和安装Struts2框架
- 如何下载和安装Struts2框架
- Struts2 框架
- struts2框架
- Struts2 框架
- Struts2框架
- Struts2框架
- Struts2框架
- Struts2框架
- struts2框架
- struts2框架
- Struts2框架
- 框架:Struts2
- struts2框架
- Struts2框架
- 【Struts2框架】Struts2总结
- JSUtil
- 【RPG Make MV】 入手序
- Jenkins+maven+git环境部署
- [开源]ApolloClr一个新的IL解释器,并且能运行在Web上
- web.xml 之 resource-ref
- 安装Struts2框架
- Oracle 操作 timestamp
- MySQL 小结(三)
- js判断checkbox是否被选中
- js 判断日期大小
- Linux常用命令(21)之用户和用户组
- ibatis CDATA
- VBA函数
- Linux常用符号指令