strut2 spring zero configuration

<struts>
	<constant name="struts.objectFactory" value="spring" />
	<constant name="struts.objectFactory.spring.autoWire" value="name" />
	<constant name="struts.configuration.xml.reload" value="true" />
	<constant name="struts.enable.SlashesInActionNames" value="false" />
	<constant name="struts.enable.DynamicMethodInvocation" value="false" />
	<constant name="struts.devMode" value="true" />
	<constant name="struts.action.extension" value="do" /> 
   
	<package name="user" extends="struts-default" >
		<action name="*.*" method="{2}"
			class="{1}Action" >
			<result name="input">validation.jsp</result>
			<result name="dispatch">/${target}.jsp</result>
			<result name="redirect" type="redirect">/${target}.action</result>
			<result name="chain" type="chain">${target}</result>
		</action>
		
	</package>
	
</struts>

 

 

<?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:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:aop="http://www.springframework.org/schema/aop"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd 
	http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd 
	http://www.springframework.org/schema/jee 
	http://www.springframework.org/schema/jee/spring-jee-2.5.xsd 
	http://www.springframework.org/schema/context 
	http://www.springframework.org/schema/context/spring-context-2.5.xsd
	http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"
	default-lazy-init="true">
	   
	
	<!-- 以AspectJ方式 定义 AOP
	<aop:config proxy-target-class="true">
		<aop:advisor pointcut="execution(* com.nail.service.impl..*Service.*(..))"
					 advice-ref="txAdvice"/>
		<aop:advisor pointcut="execution(* com.nail.dao.*Dao.*(..))" advice-ref="txAdvice"/>
	</aop:config> -->

	<!-- 基本事务定义,使用transactionManager作事务管理,默认get*方法的事务为readonly,其余方法按默认设置.
			 默认的设置请参考Spring文档事务一章. 
	<tx:advice id="txAdvice" transaction-manager="transactionManager">
		<tx:attributes>
			<tx:method name="get*" read-only="true"/>
			<tx:method name="find*" read-only="true"/>
			<tx:method name="*"/>
		</tx:attributes>
	</tx:advice>-->
	
	
	<!-- 
	<bean id="sqlMapClient"
		class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
		<property name="configLocation" value="WEB-INF/SqlMapConfig.xml" />
		<property name="dataSource" ref="dataSource" />
	</bean>
	
	
	<bean id="transactionManager"
		class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
		<property name="dataSource">
			<ref local="dataSource" />
		</property>
	</bean>
	 -->
	<context:component-scan base-package="com.nail" />
	<!-- <import resource="applicationContext-service.xml"/> -->	
	
</beans>

 

你可能感兴趣的:(spring,AOP,bean,struts,ibatis)