Struts2-安装
来源:互联网 发布:unity3d人物模型在哪里 编辑:程序博客网 时间:2024/06/05 09:00
http://struts.apache.org/release/2.3.x/docs/create-struts-2-web-application-with-artifacts-in-web-inf-lib-and-use-ant-to-build-the-application.html
Struts 2 requires Servlet API 2.4 or higher, JSP 2.0 or higher, and Java 5 or higher.
Add Struts 2 Jar Files To Class Path
Find and copy to WEB-INF\lib these files (note X.X.X.X.jar refers to the version number):
- asm-x.x.jar
- asm-commons-x.x.jar
- asm-tree-x.x.jar
- commons-io-X.X.X.jar
- commons-lang3-X.X.X.jar + commons-lang3-3.1.jar
- commons-fileupload-X.X.X.jar
- freemarker-X.X.X.jar
- javassist-X.X.X.jar
- ognl-X.X.X.jar
- struts2-core-X.X.X.X.jar
- xwork-core-X.X.X.jar
Add Struts 2 Servlet Filter
To enable the Struts 2 framework to work with your web application you need to add a Servlet filter class and filter mapping to web.xml. Below is the filter and filter-mapping nodes you should add to web.xml.
web.xml Servlet Filter
<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>
Create struts.xml
Struts 2 can use either an XML configuration file or annotations (or both) to specify the relationship between a URL, a Java class, and a view page (such as index.jsp). For our basic Struts 2 application, we'll use a minimal xml configuration. Note the file name is struts.xml and it should be in the src folder (struts.xml must be on the web application's root class path).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><constant name="struts.devMode" value="true" /><package name="basicstruts2" extends="struts-default"><action name="index"><result>/index.jsp</result></action></package></struts>
Build and Run the Application
- Struts2-安装
- Struts2 安装
- Struts2学习笔记--安装struts2
- eclipse 安装struts2 插件
- struts2基本安装
- Struts2安装配置
- struts2 安装配置
- Struts2安装与配置
- struts2安装调试(eclipse)
- Struts2的安装
- eclipse 安装struts2 插件
- 安装Struts2框架
- Struts2的下载安装
- Struts2-----2、Struts2的下载和安装
- struts2 eclipse插件的安装
- struts2 eclipse插件的安装
- 安装Struts2的一般步骤
- Struts2的安装与配置
- spring 配置的五种方式
- 设计Windows shell中set 命令的人应该好好反省一下自己(用set处理串时请注意空格)
- Vcastr 3.0 api
- GDB调试命令(转)
- dw服务端controller编码
- Struts2-安装
- sql中写事物和c#中执行事物
- 《程序员的第一年》---------- Properties.Settings 的读写
- 没有配置resolv.conf
- 浅谈Service Manager成为Android进程间通信(IPC)机制Binder守护进程之路
- 一个完整的Windows 服务从创建到安装卸载
- Web前端开发修炼之道-HTML篇
- tomcat mq 一闪而过
- SilverLight Tools 安装错误“必须先安装与Silverlight Tools 4 语言版本相一致的....”解决方法