在eclipse中搭建struts2开发环境
来源:互联网 发布:幸福蓝海网络学 编辑:程序博客网 时间:2024/05/16 14:08
在eclipse中搭建Struts2开发环境
在今天开通了自己的博客,在这里记录自己遇到的问题.
- 下载需要的jar包
- 把我们需要的包添加到项目中去,struts2基本的开发只需要六个包即可,所以我们只把这六个包添加到项目中即可,以后有需要再添加其他的包.这是我们要添加的六个包.添加jar包方法:把jar包拷贝到项目的webcontent/lib下,然后右键项目Build Path>Configure Build Path>add jars选择lib中的jar包即可.
- 在web.xml中配置struts2的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>
- 编写struts.xml,在src目录下创建struts.xml文件.在其中配置action等.
<?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="/" namespace="/" extends="struts-default"><action name="TestAction" class="cui.example.TestAction" method="login"></action></package></struts> <!-- 这里配置了一个无返回页面的TestAction,-->
- 编写相应的action类
- 启动,大功告成!~~
0 0
- 在eclipse开发环境中搭建struts2
- 在eclipse中搭建struts2开发环境
- 在Eclipse中搭建Python开发环境
- 在Eclipse中搭建Python开发环境
- 在ubuntu中搭建eclipse开发环境。
- 在Eclipse中搭建Python开发环境
- 在eclipse中搭建hibernate开发环境
- 在Eclipse下开发Struts2项目,环境搭建
- 【Struts2】eclipse 下搭建 Struts2 开发环境
- Eclipse下搭建Struts2开发环境
- JavaEE eclipse+struts2开发环境搭建
- Eclipse中 struts2 + spring3 + mybatis3 环境搭建
- Eclipse中 struts2 + spring3 + mybatis3 环境搭建
- 在eclipse中搭建cocos2d-x的android开发环境
- 在Eclipse/MyEclipse中搭建Android开发环境
- 在Eclipse中开发OSGi(1)搭建Felix环境
- 在eclipse中android NDK开发环境的搭建
- 在eclipse中android NDK开发环境的搭建
- 安全卫士5--MD5加密
- Java 1.5并发包之三:线程池实现之Fork/Join框架
- SDAU 练习三 1004 谦逊(卑微)数字
- 《Windows API》读取文件
- 恒生电子实习面筋
- 在eclipse中搭建struts2开发环境
- 关于hasnextLine()方法的一些理解
- QT5。怎么开启C++11标准
- 理解RESTful架构
- Java NIO系列教程(一) Java NIO 概述
- swift Reflection(字典转模型)变量继承本类类名解决办法
- 排列-hdu_1027_Ignatius and the Princess II
- Scala函数式编程原理 第二课 编程的本质(Elements of programing)
- opencv检测四边形/多边形