SSH整合时候的常用配置
来源:互联网 发布:网络无抵押贷款平台 编辑:程序博客网 时间:2024/04/29 10:03
首先<span style="white-space:pre"></span>hibernate.cfg.xml<span style="white-space:pre"></span>配置文件
<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><!-- Generated by MyEclipse Hibernate Tools. --><hibernate-configuration><session-factory><property name="dialect">org.hibernate.dialect.MySQLDialect</property><property name="connection.url">jdbc:mysql://localhost:3306/test</property><property name="connection.username">root</property><property name="connection.password">123456</property><property name="connection.driver_class">com.mysql.jdbc.Driver</property><property name="myeclipse.connection.profile">mysql</property><property name="show_sql">true</property><property name="hbm2ddl.auto">update</property><mapping resource="com/my/domain/ClassBean.hbm.xml" /></session-factory></hibernate-configuration>
接着 applicationContext.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:aop="http://www.springframework.org/schema/aop"xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"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/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"><bean id="sessionFactory"class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"><property name="configLocation"><value>classpath:hibernate/hibernate.cfg.xml</value></property></bean><bean id="transactionManager"class="org.springframework.orm.hibernate3.HibernateTransactionManager"><property name="sessionFactory"><ref bean="sessionFactory" /></property></bean><tx:advice transaction-manager="transactionManager" id="tx"><tx:attributes><tx:method name="save*" read-only="false" /></tx:attributes></tx:advice><aop:config><aop:pointcut expression="execution(* com.my.service.impl.*.*(..))"id="perform" /><aop:advisor advice-ref="tx" pointcut-ref="perform" /></aop:config></beans>配置 struts.xml文件
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE struts PUBLIC"-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN""http://struts.apache.org/dtds/struts-2.1.7.dtd"><struts> <!-- 配置文件改了以后不用重新启动 --> <constant name="struts.devMode" value="true"/></struts>配置 web.xml文件
<?xml version="1.0" encoding="UTF-8"?><web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <display-name></display-name> <listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener><context-param><param-name>contextConfigLocation</param-name><param-value>classpath:spring/applicationContext.xml</param-value></context-param><filter><filter-name>struts2</filter-name><filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class></filter><filter-mapping><filter-name>struts2</filter-name><url-pattern>/*</url-pattern></filter-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list></web-app>
一切ok!!!!!!!!!!!!!!!!!!
0 0
- SSH整合时候的常用配置
- ssh整合的配置
- ssh整合的配置
- 整合ssh的时候遇到的错误
- SSH框架整合的时候 在web.xml中需配置的spring信息与struts2的配置信息
- 配置SSH的时候,整合struts2和spring的时候,bean一直报defind,原来是配置路径多了个空格
- SSH 整合的时候用到的Struts2 jar包
- 整合ssh的时候出现空指针java.lang.NullPointerException
- SSH整合的时候启动tomcat报错
- ssh整合web.xml的配置
- ssh整合中事物的配置
- SSH整合中web.xml的配置
- ssh三大框架整合的配置
- ssh整合后web.xml的配置
- dwr整合ssh的xml配置方式
- dwr整合ssh 的annotation配置方式
- SSH整合配置声明事务的步骤
- SSH框架整合 基于 XML 的配置
- 【Java TCP/IP Socket】基于线程池的TCP服务器(含代码)
- Oracle Validated Configurations与Preinstall RPM
- EL表达式
- 2014嘉杰信息杯ACM/ICPC湖南程序设计邀请赛暨第六届湘潭市程序设计竞赛
- 计算机常用网站
- SSH整合时候的常用配置
- 2376_ants(巧妙避开了申请大容量数组,思路上采用单个蚂蚁独立分析,而非将全部数据输入后才统一比较)
- 【Java TCP/IP Socket】基于NIO的TCP通信(含代码)
- Android多媒体--音乐播放器实例
- 制作iso
- [总结] Android平台架构以及特征
- 自己收集五款常用的HTML编辑软件
- SAP NetWeaver CE中实现邮件的发送功能
- 【Java TCP/IP Socket】Java NIO Socket VS 标准IO Socket