- 浏览: 1462569 次
- 性别:
- 来自: 广东
-
文章分类
- 全部博客 (190)
- eclipse (5)
- struts (15)
- spring (1)
- hibernate (0)
- myeclipse (3)
- java (35)
- apache (1)
- PHP (7)
- 虚拟机 (0)
- 网络安全 (3)
- 防火墙 (1)
- linux (7)
- SVN (22)
- 测试文档 (1)
- 测试经验 (0)
- 项目管理 (0)
- BUG管理工具 (3)
- 安装配置 (3)
- 性能工具 (7)
- 脚本学习 (0)
- 协议选择 (0)
- loadrunner错误处理 (0)
- 相关监控配置 (0)
- 框架的认识 (0)
- 手动关联 (0)
- 性能调优 (1)
- 负载均衡 (0)
- 代码学习 (1)
- Windows (5)
- 软件开发安全 (0)
- 考研经验 (1)
- SQL SERVER (1)
- MySQL (6)
- LVS (0)
- ORACLE (1)
- TOMCAT (0)
- 开源框架 (1)
- EOS (3)
- web (5)
- JEECMS (7)
- XML (1)
- LDAP (3)
- ehcache (1)
- Ajax (3)
- OpenSourceTools (1)
- Exception (1)
- 密码学 (1)
- os-centos (1)
- os-ubuntu (0)
- os-FreeBSD (0)
- os-Fedora (0)
- 浏览器-chrome (1)
- flex (1)
- 数据结构与算法 (0)
最新评论
-
joedan0104:
挺方便的,谢谢
JDK1.6官方下载_JDK6官方下载地址:http://www.java.net/download -
naruik:
非常感谢,不用自己找了。收藏和关注了。
JDK1.6官方下载_JDK6官方下载地址:http://www.java.net/download -
scd01234:
感谢!
JDK1.6官方下载_JDK6官方下载地址:http://www.java.net/download -
qingcheng123:
大虾,5.3这个版本有没有下载地址呀,谢谢!
EOS5.3+Tomcat5.0.28升级JDK1.5解决方案 -
1021082712:
JDK1.6官方下载_JDK6官方下载地址:http://www.java.net/download
我们知道struts1与spring整合是靠org.springframework.web.struts.DelegatingActionProxy来实现的,以下通过具体一个用户登录实现来说明struts2整合spring的相关内容.
一、准备工作
1.实例分析我们在这不与数据库打交道,所有就是当用登录的时候判断用户名是否为指定值,密码是否为指定值,以及相关的异常处理、
2.为什么我们要说struts2整合spring呢?相信在家都知道,我也不用多说了....
4.在 http://struts.apache.org/download.cgi#struts212下载struts2的jar包,源码,API文档.
5.在 http://static.springframework.org/downloads/nightly/release-download.php下载不同版本的spring的jar包,源码,API文档.
6.配置开发环境:MyEclipse6.0+Eclipse3.3+JDK6.0+Tomcat6.0+Struts 2.0.11+spring2.0。
7.新建web项目,导入相应的jar包,如以下所示:
a.由于现在IDE开发工具还没有对struts2.0有很好的支持,所有我们需要手功配置,首先将我们刚下下来的struts2.0的lib里面的commons-logging-1.0.4.jar、ognl-2.6.11.jar、xwork-2.0.4.jar、freemarker-2.3.8.jar、struts2-core-2.0.11.1.jar以及struts2.0里面所需要的插件包struts2-spring-plugin-2.0.11.1.jar添加的WEB-INF/lib下面
b.通过通过IDE开发工具项目对spring2.0的支持
7.在src下建立struts.xml文件(具体的写法在后面呈现)
8.配置web.xml,如下:
五、测试(全部成功)

































二、建立前台页面
1.用户登录肯定有一个用户登录页面login.jsp,如下:






















2.若登录成功的index.jsp文件,如下:



















3、用户名非法提示页面.usernameInvalid.jsp(通过el表达示得到异常信息)















4、密码非法提示页面.passwordInvalid.jsp(struts2标签得到异常信息);

















三、建立对应的action
1.提供用户请求服务的LoginService类









































2.接收用户请求的LoginAction类







































































发表评论
-
Struts2 文件上传文件类型allowedTypes汇总
2010-05-19 17:48 1721Struts2 文件上传文件类型allowedTypes汇总 ... -
设置Struts2文件上传的类型和大小
2010-05-19 16:42 2118设置Struts2文件上传的类型和大小 设置Struts ... -
Struts2多文件上传
2010-05-19 16:37 1386Struts2多文件上传 Struts2多文件上传: 在 ... -
Struts2文件上传详解
2010-05-19 16:36 1401Struts2文件上传详解 St ... -
JSP 生成随机验证码图片(经典老代码)
2010-03-21 17:29 1431JSP 生成随机验证码图片(经典老代码) ... -
封装了 Jakarta 文件上传功能的一个类
2010-03-21 17:28 1400封装了 Jakarta 文件上传功能的一个类 后 ... -
在Eclipse下创建Jeecms项目图文指南2009-12-30 15:30 Jeecms作为一个开源项目自发布以来受到全国各地JEE用户及爱好者的广泛关注
2010-03-06 12:34 1905在Eclipse下创建Jeecms项目 ... -
在Myeclipse7中整合struts2+spring2.5+hibernate3.2
2009-11-23 16:51 1745在Myeclipse7中整合struts2+spring2.5 ... -
请不要做浮躁的人(转载)
2009-11-23 16:45 1050请不要做浮躁的人(转 ... -
整合Struts2+JasperReport Web报表应用示例
2009-11-23 16:43 3754整合Struts2+JasperReport Web报表应用示 ... -
struts2 get 请求 下载 中文处理
2009-11-23 16:40 1578struts2 get 请求 下载 中文处理 最近因项目 ... -
struts2 get 请求 下载 中文处理
2009-11-23 16:37 1503Struts2操作request、session和appli ... -
strtus2 批量下载 中文问题、压缩文件等 ------ 讨论struts2工作流程
2009-11-23 16:34 2526strtus2 批量下载 中文问题、压缩文件等 ------ ... -
Struts Spring Hibernate 面试题
2009-03-03 14:38 2197Struts Spring Hibernate 面试题 ...
相关推荐
总的来说,Struts2整合Spring3.0可以带来诸多好处,如简化MVC配置,利用Spring的IoC和AOP特性,以及提高代码的可测试性和可维护性。通过上述配置和编程实践,开发者可以构建出高效且灵活的Java EE应用程序。
Struts2整合Spring和JPA是企业级Java应用开发中常见的技术组合,它们分别负责不同的职责:Struts2作为一款成熟的MVC框架,主要用于处理Web层的请求与响应;Spring作为一个全面的轻量级框架,提供了依赖注入(DI)和...
Struts2 和 Spring 的整合是Java Web开发中的常见实践,这两种框架的结合可以极大地提高应用的可维护性和灵活性。在本文中,我们将深入探讨如何实现Struts2与Spring的集成,以及利用拦截器来增强应用的功能。 首先...
整合使用最新版本的三大框架(即Struts2、Spring4和Hibernate4),搭建项目架构原型。 项目架构原型:Struts2.3.16 + Spring4.1.1 + Hibernate4.3.6。 此外,还有:log4j、slf4j、junit4、ehcache等知识点。 项目...
Struts2、Spring和Hibernate是Java Web开发中的三大框架,它们各自在应用程序的...这个案例提供了一个实用的起点,帮助开发者理解如何在实际项目中将Struts2、Spring和Hibernate结合,以实现高效的Java Web应用开发。
《精通Java EE Eclipse Struts2 Hibernate Spring整合应用案例 源代码18章 bookstore》是针对Java企业级开发的一份重要资源,旨在帮助开发者深入理解并掌握如何在Eclipse环境中集成Struts2、Hibernate和Spring框架...
### Struts 2 整合 Spring 的关键技术点 #### 一、Struts 2 和 Spring 简介 - **Struts 2**:作为Java Web应用开发中的一个重要框架,Struts 2 提供了一种灵活的方式来构建MVC(Model-View-Controller)架构的应用...
《精通JavaEE Eclipse Struts2 Hibernate Spring整合应用案例 源代码15章 noticemanager》这个资源是针对Java企业级开发的学习资料,旨在帮助开发者深入理解和实践JavaEE平台上的Struts2、Hibernate和Spring这三个...
这个"Struts2+Spring演示实例源代码"旨在展示如何将这两个框架整合在一起,以实现更高效、更模块化的Web应用开发。通过这个实例,开发者可以学习到以下关键知识点: 1. **Struts2框架**: - **Action类**:它是...
整合Struts2和Spring2有助于提升应用的可扩展性和可维护性,使开发者能够更专注于业务逻辑,而非对象的创建和管理。此外,Spring的事务管理能力也能很好地配合Struts2,为Web应用提供更健壮的服务。然而,随着Spring...
在整合中,Spring用于管理Struts2和Hibernate的实例,通过IoC容器进行依赖注入,同时可以提供事务管理,确保数据的一致性。 整合过程: 1. 配置环境:首先需要在项目中引入Struts2、Hibernate和Spring的相应库,并...
在Struts2和Spring整合中,可以使用Spring提供的拦截器,例如`org.springframework.web.struts.DelegatingInterceptor`,它能让Spring容器处理Action的实例化。 7. **事务管理**:Spring提供了强大的事务管理功能。...
Struts2、Spring和Hibernate是Java Web开发中的三大框架,它们的整合应用,通常被称为SSH(Struts2、Spring、Hibernate)集成。这个"struts2+spring+hibernate整合小案例"是一个用于教学和实践的DEMO,旨在帮助...
整合Struts2和Spring的主要目的是实现业务逻辑层(Service)和控制层(Controller)的解耦,使得应用更具灵活性和可维护性。以下是一些关于整合过程的关键知识点: 1. **依赖注入**:Spring的核心特性之一就是依赖...
2. **Spring的Action类管理**:在整合后,Struts2的Action类不再直接创建服务类的实例,而是由Spring容器提供。这样可以利用Spring的事务管理、AOP等功能,使Action类更专注于业务逻辑。 3. **Struts2的插件机制**...
总的来说,"Struts2_Spring_Hibernate整合开发实例"为开发者提供了一个全面的学习资源,涵盖了从基础配置到高级特性的应用。通过阅读和实践这个实例,开发者不仅可以理解三大框架的基本用法,还能掌握实际开发中的...
Spring 和 Struts2 是两个...总之,Spring 和 Struts2 的整合利用了两者的优势,提供了一种强大的方式来构建可扩展、易于维护的 Java Web 应用。通过深入学习和实践,开发者可以掌握这种整合技巧,并在实际项目中应用。
《精通Java EE—Eclipse Struts2 Hibernate Spring整合应用案例(第2版)》是一部针对Java企业级开发的深入教程,特别关注了四个关键的技术框架:Eclipse、Struts2、Hibernate和Spring。这些框架在现代Java应用开发中...
Struts2、Spring和MyBatis是Java Web开发中三个非常重要的开源框架,它们各自在应用程序的不同层面上发挥着重要作用。Struts2是MVC(Model-View-Controller)架构的实现,负责处理用户请求并转发到相应的业务逻辑;...
Struts2、Spring和Hibernate是Java开发中三大主流框架,它们各自解决不同的问题,并且可以协同工作,构建出高效、可维护的企业级Web应用程序。在本实例中,我们将深入探讨这三个框架的核心概念、功能以及如何将它们...