struts2.0.14+spring2.5+hibernate3.2整合方法二
spring写bean,并在配置文件写注入;action的class写bean的名称
applicationContext-beans.xml
<?xml version="1.0" encoding="GBK"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<bean id="userService" class="demo.service.UserServiceImpl">
<property name="userDao" ref="userDao"></property>
</bean>
<bean id="userDao" class="demo.dao.UserDaoImpl"></bean>
<bean id="loginAction" class="demo.action.LoginAction" scope="prototype">
<property name="userService" ref="userService"></property>
</bean>
</beans>
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>
<!-- 已经导入了struts-spring-plugin包所以在struts.xml里面不需要再配置这个常量
<constant name="struts.objectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory" />-->
<package name="struts2" extends="struts-default">
<action name="Login" class="loginAction" method="Login">
<result name="success" type="redirect">listUser.action</result>
<result name="input">/login.jsp</result>
</action>
<action name="addUser" class="loginAction" method="addUser">
<result name="success">/addUser.jsp</result>
</action>
<action name="saveUser" class="loginAction" method="saveUser">
<result name="success" type="redirect">listUser.action</result>
</action>
<action name="listUser" class="loginAction" method="listUser">
<result name="success" >/listUser.jsp</result>
</action>
<action name="securityCodeImage" class="loginAction" method="securityCodeImage">
<result name="success" >/listUser.jsp</result>
</action>
</package>
</struts>
其实文件看struts2.0.14+spring2.5+hibernate3.2整合方法一
分享到:
相关推荐
Struts2.0.14+Spring2.5.6+Struts.1.3.8+Hibernate3.2,这里集合了struts,hibernate,Spring的核心包,都是核心的,重要文件
Struts2.0.14+Spring2+Hibernate3 无冲突JAR包 测试通过,省下配来配去的功夫。
Struts2.0.14+Spring2.5+Hibernate3.2+Oracle10g+Tomcat6.0开发环境配置,有步骤图示 +web.xml+applicationContext.xml文件配置 还算齐全。。。
整合Struts2.0.14+Spring2.6+Hibernate3.1
自己花好几天写的真正有效可运行的Maven2搭建的SSH2登录实例。 Struts2.0.14;Hibernate3.2.6.ga;Spring2.5.6;Maven2.0.11 任何问题,请联系luguangjin@msn.com
三大框架基本包(spring,hibernate,struts)包含commons-beanutils,dom4j-1.6.1,hibernateOrJPA,spring2.5.6,struts-1.3.8-lib,struts2.0.14
antlr-2.7.2.jar asm.jar aspectjrt.jar aspectjweaver.jar cglib-2.1.jar commons-collections.jar commons-dbcp.jar commons-fileupload.jar ...struts2-spring-plugin-2.0.14.jar xwork-2.0.7.jar
API.chm、struts2.0.14.chm、struts2.1.8.1-API.chm、tango.chm这些api,基本上包括java开发中用的所有api,由于文件过大压缩的时候压缩成十二个文件,压缩的格式是zip格式的,把十二文件放在同一个目录下面进行解压...
API.chm、struts2.0.14.chm、struts2.1.8.1-API.chm、tango.chm这些api,基本上包括java开发中用的所有api,由于文件过大压缩的时候压缩成十二个文件,压缩的格式是zip格式的,把十二文件放在同一个目录下面进行解压...
API.chm、struts2.0.14.chm、struts2.1.8.1-API.chm、tango.chm这些api,基本上包括java开发中用的所有api,由于文件过大压缩的时候压缩成十二个文件,压缩的格式是zip格式的,把十二文件放在同一个目录下面进行解压...
API.chm、struts2.0.14.chm、struts2.1.8.1-API.chm、tango.chm这些api,基本上包括java开发中用的所有api,由于文件过大压缩的时候压缩成十二个文件,压缩的格式是zip格式的,把十二文件放在同一个目录下面进行解压...
API.chm、struts2.0.14.chm、struts2.1.8.1-API.chm、tango.chm这些api,基本上包括java开发中用的所有api,由于文件过大压缩的时候压缩成十二个文件,压缩的格式是zip格式的,把十二文件放在同一个目录下面进行解压...
API.chm、struts2.0.14.chm、struts2.1.8.1-API.chm、tango.chm这些api,基本上包括java开发中用的所有api,由于文件过大压缩的时候压缩成十二个文件,压缩的格式是zip格式的,把十二文件放在同一个目录下面进行解压...
API.chm、struts2.0.14.chm、struts2.1.8.1-API.chm、tango.chm这些api,基本上包括java开发中用的所有api,由于文件过大压缩的时候压缩成十二个文件,压缩的格式是zip格式的,把十二文件放在同一个目录下面进行解压...
API.chm、struts2.0.14.chm、struts2.1.8.1-API.chm、tango.chm这些api,基本上包括java开发中用的所有api,由于文件过大压缩的时候压缩成十二个文件,压缩的格式是zip格式的,把十二文件放在同一个目录下面进行解压...
API.chm、struts2.0.14.chm、struts2.1.8.1-API.chm、tango.chm这些api,基本上包括java开发中用的所有api,由于文件过大压缩的时候压缩成十二个文件,压缩的格式是zip格式的,把十二文件放在同一个目录下面进行解压...
API.chm、struts2.0.14.chm、struts2.1.8.1-API.chm、tango.chm这些api,基本上包括java开发中用的所有api,由于文件过大压缩的时候压缩成十二个文件,压缩的格式是zip格式的,把十二文件放在同一个目录下面进行解压...
API.chm、struts2.0.14.chm、struts2.1.8.1-API.chm、tango.chm这些api,基本上包括java开发中用的所有api,由于文件过大压缩的时候压缩成十二个文件,压缩的格式是zip格式的,把十二文件放在同一个目录下面进行解压...
API.chm、struts2.0.14.chm、struts2.1.8.1-API.chm、tango.chm这些api,基本上包括java开发中用的所有api,由于文件过大压缩的时候压缩成十二个文件,压缩的格式是zip格式的,把十二文件放在同一个目录下面进行解压...
hibernate-3.2.0.cr5.zip spring-framework-2.5.5.zip struts-2.0.14-all.zip