Spring 3.1.1 + Struts 2.3.1.2 + Hibernate 4.1 整合(SSH)(四)

2014-11-24 07:23:29 · 作者: · 浏览: 2
EQUIRED,-java.lang.Exception




class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"
p:beanNames="*Service,*ServiceImpl" p:interceptorNames="transactionInterceptor" />












SpringBean配置文件(applicationContext-beans.xml):

[html]
< xml version="1.0" encoding="UTF-8" >
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:p="http://www.springframework.org/schema/p" xmlns:util="http://www.springframework.org/schema/util"
xmlns:tool="http://www.springframework.org/schema/tool" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/tool
http://www.springframework.org/schema/tool/spring-tool.xsd"
default-lazy-init="true" default-autowire="byName" >


class="com.eriloan.web.test.service.impl.TestServiceImpl"
scope="singleton" />
scope="prototype" />




Struts2 配置主配置文件(struts.xml):

[html]
< xml version="1.0" encoding="UTF-8" >

"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">










/errorPage/index.jsp
/login.jsp
/quitSys.jsp
/loginAction!loginPage.action


text/html
ajax_json


/WEB-INF/errorPage/ServiceException.jsp

/WEB-INF/errorPage/ServiceException.jsp

/WEB-INF/errorPage/ServiceException.jsp

/WEB-INF/errorPage/ServiceException.jsp





exception="system.exception.ActionException" />

exception="system.exception.ServiceException" />

exception="system.exception.DaoException" />













Struts 2业务配置文件(test_Struts.xml):

[html]
< xml version="1.0" encoding="UTF-8" >

"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">





/page/test/testPage.jsp




Struts2 属性