SSH框架整合配置文件模式1
来源:互联网 发布:用手机可以开淘宝店吗 编辑:程序博客网 时间:2024/06/06 08:55
配置文件的分析:
web.xml中的配置
<!--定义Spring的配置-->
<context-param>
<param-name>
contextConfigLocation
</param-name>
<param-value>
classpath*:applicationContext-*.xml
</param-value>
</context-param>
<!--配置监听器-->
<listener>
<listener-class></listener-class>
</listener>
<!--OpenSessionInViewFilter-->
<filter>
<filter-name></filter-name>
<filter-class></filter-class>
</filter>
<filter-mapping>
<filter-name></filter-name>
<url-pattern></url-pattern>
</filter-mapping>
struts.xml的配置文件
<struts>
<package name="" namespace="" extends="">
<action name="xxx" class="xxxAction">
<result name="">/xx.jsp</result>
</action>
<!--通配符的引用-->
<action name="*" class="{1}Action">
<result name="">/{1}_xx.jsp</result>
</action>
</package>
</struts>
applicationContext-common.xml配置文件(包括Hibernate和Spring的配置)
<beans>
<!--启用注解注入-->
<context:annotation-config/>
<!--启用注解扫描-->
<context:component-scan base-package="包名"/>
<!--配置数据库-->
<bean id="dataSource" class="">
<property name="driverClassName" value=""/>
<property name="url"/ value="">
<property name="username" value=""/>
<property name="password" value=""/>
</bean>
<!--配置Spring的SessionFactory-->
<bean id="" class="">
<property name="dataSource" ref="dataSource">
<property name="hibernateProperties">
<value>
</value>
</property>
<property name="mappingResource">
<list>
<value>com/oa/model/类名.hbm</value>
</list>
</property>
</bean>
<!--配置事务管理-->
<bean id="txManager" class="">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<!--配置事务通知-->
<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attribute>
<tx:method name="find*" read-only="true"/>
<tx:method name="get*" read-only="true"/>
<tx:method name="*"/>
</tx:attribute>
</tx:advice>
<!--配置事务切面-->
<aop:config>
<aop:pointcut id="fooServiceOperation" ref=""/>
</aop:config>
</beans>
common.xml的配置
<struts>
<constant name="" value="struts-default"/>
<package name="" abstract="true" extends="struts-default">
<interceptors>
<interceptor name="" class=""/>
<interceptors>
<interceptor-stack name="">
<interceptor-ref name=""/>
</interceptor-stack>
<!--定义全局变量-->
<global-results>
<result name=""/>
</global-results>
<!--定全局异常-->
<global-exception-mappings>
<exception-mapping result="" exception=""/>
</global-exception-mappings>
</package>
</struts>
- SSH框架整合配置文件模式1
- SSH框架整合配置文件模式2
- 整合SSH框架配置文件
- ssh框架整合实例子1-配置文件
- SSH框架整合模板配置文件
- 整合ssh框架的配置文件
- 框架SSH整合的配置文件
- SSH之三大框架整合配置文件
- ssh三大框架整合-配置文件
- 三大框架(ssh)整合之配置文件
- SSH框架整合的MAVEN项目之配置文件整合
- SSH整合(1)-最小整合框架
- Java-SSH框架整合配置文件的配置以及事务处理
- SSH三大框架整合后的配置文件详解
- ssh三大框架整合配置文件及测试代码
- SSH框架整合——基于XML配置文件
- SSH三大框架整合后的配置文件详解
- SSH整合之配置文件
- 7k面试题
- POJ3255
- hdu 4339 Query(线段树)
- 自定义标题栏 android
- android文字标签处理
- SSH框架整合配置文件模式1
- JAVA基础学习精简心得笔记整理
- 找出相同数据
- SSH框架整合配置文件模式2
- 差异化体验 有信免费电话或成国际化社交黑马
- MySQL必知必会知识点1
- JS 网站性能优化笔记
- 基础整理
- 远程桌面全屏快捷键