struts.xml:
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="struts-default.xml"/>
<constant name="struts.objectFactory" value="spring" />
<bean type="com.opensymphony.xwork2.ObjectFactory" name="spring"
class="org.apache.struts2.spring.StrutsSpringObjectFactory" />
<include file="struts-login.xml"></include>
</struts>
struts-login.xml:
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="com.oohla.uni.sysadmin.ui.action.login" namespace="/login" extends="struts-default">
<action name="login" class="loginAction">
<result>/common/main.jsp</result>
<result name="relogin">/login.jsp</result>
</action>
<action name="validate" class="com.oohla.uni.sysadmin.web.ValidateAction">
</action>
</package>
</struts>
applicationContext.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<!-- 登录 -->
<import resource="classpath:applicationContext-login.xml" />
</beans>
applicationContext-login.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="loginAction" class="com.oohla.uni.sysadmin.login.ui.action.LoginAction" scope="prototype">
<property name="loginService" ref="loginService"></property>
<property name="contactBiz" ref="contactBiz"></property>
</bean>
</beans>
applicationContext-service.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<!-- 创建登陆接口 -->
<bean id="loginService" class="com.oohla.uni.sso.user.LoginService"
factory-bean="proxyLoginService"
factory-method="create"/>
<!-- 登陆接口工厂 -->
<bean id="proxyLoginService" class="org.apache.cxf.frontend.ClientProxyFactoryBean">
<property name="serviceClass" value="com.oohla.uni.sso.user.LoginService"/>
<property name="address" value="http://192.168.0.150:9000/api/v1/sso/user/LoginService"/>
</bean>
<!-- 数据库操作接口 -->
<bean id="contactBiz" class="com.oohla.uni.database.biz.ContactBiz"
factory-bean="proxyService"
factory-method="create"/>
<!-- 数据库操作工厂 -->
<bean id="proxyService" class="org.apache.cxf.frontend.ClientProxyFactoryBean">
<property name="serviceClass" value="com.oohla.uni.database.biz.ContactBiz"/>
<property name="address" value="http://192.168.0.150:9000/api/v1/database/ContactBiz"/>
</bean>
</beans>
分享到:
相关推荐
struts2+spring+hibernate 配置文件struts2+spring+hibernate 配置文件
搭建 Struts2+Spring+Hibernate 框架中的 Action 单元测试环境需要解决三个主要问题:如何测试 Action?如何解决 JPA 中的 Lazy 机制?如何做用户 Session 管理?通过使用 StrutsSpringTestCase 和 junit4.jar,可以...
Struts2+Spring+Hibernate集成开发环境的配置小例子。
最求效率 struts1+spring2.5.6+jdbc
《轻量级Java EE企业应用实战:Struts2+Spring4+Hibernate整合开发(第4版)》是《轻量级Java EE企业应用实战》的第4版,第4版保持了前几版内容全面、深入的特点,主要完成全部知识的升级。 《轻量级Java EE企业...
Struts2+hibernate+spring开发,使用MySQL数据,实现学生基本信息的增删改查功能,但是页面不美观
一个struts2+spring+hibernate+dwr的小实例,不过木有搭建说明,不过有dwr的使用说明,至于表结构可以看映射配置文件就知道创建什么表了
struts2+spring+hibernate配置文件详解 struts2+spring+hibernate配置文件详解
• 采用hibernate3+struts2+spring2+freemarker主流技术架构 • 懂html就能建站,提供最便利、合理的使用方式 • 强大、灵活的标签,用户自定义显示内容和显示方式 • 在设计上自身预先做了搜索引擎优化,增强对...
Struts2+Spring3+Hibernate4零配置所需全部jar包
2.Action里通过struts2-spring-plugin.jar插件自动根据名字注入。 3.Ajax无刷新异步调用Struts2,返回Json数据,以用户注册为例。 4.在服务端分页查询功能,优点:实时性:跳页才查询。数据量小:只加载当前页的记录...
ssh struts2+spring+hibernate配置示例 ssh配置
Struts2+spring注解配置 很好哦
简单struts+spring+hibernate搭建,配置,适合初学者
Struts2+Spring+Ibatis环境配置.doc 详细讲解如何配置Struts2+Spring+Ibatis开发环境
java8+tomcat8+struts2.5+spring4.3+hibernate5.2框架搭建详细过程
建表SQL(ORACLE) 博文链接:https://shaotiwei.iteye.com/blog/114998
2、在sping配置中注意单元测试里,xml文件的路径问题,要用绝对路径。 3、struts.xml中命名空间和拦截器的使用。 4、sqlmapconfig.xml中传入参数和result的设置,只需要将得到的值result映射到有此属性的类对象. 5、...
b 在struts.xml中添加action,使用通配符的方式 , 注意这里和单独struts2不同的地方: class属性指向的是bean 的 id ,这里我们配置bean采用spring ioc注解的方式, 所以默认的bean的id 为 类名(首字母小写) ...
本框架为struts2+spring3+hibernate4+urlrewrite(伪静态地址) Struts采用通配,web-inf下的urlrewrite.xml为伪静态配置文件,跳转到struts.xml进行对应