Struts2.0 (开发之一)--简介与简单登录的实现--CTO
来源:互联网 发布:淘宝上的正品已验证 编辑:程序博客网 时间:2024/06/16 10:07
转载时请注明文章出处 : http://blog.csdn.net/ctojxzsycztao 作者 : ctojxzsycztao 上一编文章写的太突然了,没有考滤到朋友们对struts2 的了解,就埋下了伏笔,真不好意思,因为本人对struts2的理解有限,所以也只能做简单介绍,还请各位读友多多见解.
Struts2简单介绍 : struts2与struts1.x的最大区别在于,struts1.x需要继承 Action 而struts2不需继承任何类,是一个完整的POJO,更方便扩展,调试,struts1.x 的Action 就难以调试,它的状态完全由struts1.x 容器进行管理,struts2 吸收webwork2的优点,是struts1.2和webwork2 强强联合的精华,集合了spring 的 ioc/di思想. 其最大的优点在于Action 不用再继承Action,方法名也不再是限于execute,可以任由开发人员定义,每个方法都返回一个String ,方便调试 便于脱离Struts2框架
开发环境: tomcat5.5.20 和 jdk1.5 及以上:
Struts2 的开发过程 : 一 . 首先到 http://struts.apache.org/ 下载所需要的开发包,其中包括以下jar文件:commons-logging-1.1.jar , freemarker-2.3.8.jar , ognl-2.6.9.jar , struts2-api-2.0.5.jar , struts2-core-2.0.5.jar , xwork-2.0.0.jar , 二. jar 包下载下来应包含以上 jar 文件 , 将这些 jar 文件copy到工程项目的 lib 目录下, 三 . 添加一个action , 一个完整的 action 如下:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
二. 在classpath的根目录下添加 struts.xml,struts.xml 文件内容如下:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
- Struts2.0 (开发之一)--简介与简单登录的实现--CTO
- Struts2.0 (开发之一)--简介与简单登录的实现--CTO
- struts2的环境配置与简单登录功能实现
- Struts2实现简单的登录效果
- 用struts2实现简单的登录
- struts2 简单实现用户登录
- struts2实现登录用户的简单的权限设置
- 【Apache Mina2.0开发之一】搭建Apache Mina框架并实现Server与Client端的简单消息传递!
- 【Apache Mina2.0开发之一】搭建Apache Mina框架并实现Server与Client端的简单消息传递!
- 【Apache Mina2.0开发之一】搭建Apache Mina框架并实现Server与Client端的简单消息传递!
- 【Apache Mina2.0开发之一】搭建Apache Mina框架并实现Server与Client端的简单消息传递!
- 【APACHE MINA2.0开发之一】搭建APACHE MINA框架并实现SERVER与CLIENT端的简单消息传递!
- java Struts2 框架的搭建与简单的登录验证
- Spring+Struts2+JQuery配合实现简单的登录功能
- struts2入门学习篇:实现一个简单的登录操作
- Struts2 第一课 入门配置与 简单的登录
- Struts2.0 (开发之二)--跟踪用户状态--CTO
- Struts2.0 (开发之三)--数据校验框架--CTO
- 择录自WINDOWS源码的提权函数
- Flex 实践——信息管理系统version1 展示
- 第一个struts2程序
- Powerbuilder11将C/S程序转换为B/S ASP.NET
- SimpleCollection.java
- Struts2.0 (开发之一)--简介与简单登录的实现--CTO
- Linux上网,我知道
- Foo1.java
- HEAP错误
- 电信重组,新机遇还是新危机?
- HEAP错误
- 无法定位序数801于动态数据库msjet40.dll上
- JAVA文本编辑(编译)器
- 论文最后的致谢