flex4+sdk4+spring3+hibernate3整合开发
发布时间:2020-12-15 01:27:11 所属栏目:百科 来源:网络整理
导读:所需环境: flex4 sdk4 spring3 hibernate3 eclipse3.4 jdk1.6 tomcat6以上(必须是安装版) ? spring配置文件: ? ? xml version="1.0" encoding="UTF-8" ? - beans xmlns =" http://www.springframework.org/schema/beans " xmlns:flex =" http://www.spri
所需环境: flex4 sdk4 spring3 hibernate3 eclipse3.4 jdk1.6 tomcat6以上(必须是安装版) ? spring配置文件: ? <?xml version="1.0" encoding="UTF-8" ?>
-
<
beans
xmlns
="
http://www.springframework.org/schema/beans
"
xmlns:flex
="
http://www.springframework.org/schema/flex
"
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
"
xsi:schemaLocation
="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/flex http://www.springframework.org/schema/flex/spring-flex-1.0.xsd
">
?
<
flex:message-broker
/>
-
<
bean id
="
testService
"
class
="
com.longtop.test.TestService
">
?
<
flex:remoting-destination
/>
?
<
property
name
="
testDao
"
ref
="
testDao
" />
?
</
bean
>
-
<
bean id
="
dataSource
"
class
="
org.springframework.jdbc.datasource.DriverManagerDataSource
">
?
<
property
name
="
driverClassName
"
value
="
com.mysql.jdbc.Driver
" />
?
<
property
name
="
url
"
value
="
jdbc:mysql://localhost:3306/test
" />
?
<
property
name
="
username
"
value
="
root
" />
?
<
property
name
="
password
"
value
="
root
" />
?
</
bean
>
-
<
bean id
="
sessionFactory
"
class
="
org.springframework.orm.hibernate3.LocalSessionFactoryBean
">
-
<
property name
="
dataSource
">
?
<
ref
bean
="
dataSource
" />
?
</
property
>
-
<
property name
="
mappingResources
">
?
<
value
>
com/longtop/test/Person.hbm.xml
</
value
>
?
</
property
>
-
<
property name
="
hibernateProperties
">
-
<
props
>
?
<
prop key
="
hibernate.dialect
">
org.hibernate.dialect.MySQLDialect
</
prop
>
?
</
props
>
?
</
property
>
?
</
bean
>
-
<
bean id
="
testDao
"
class
="
com.longtop.test.TestDaoImp
">
-
<
property name
="
sessionFactory
">
?
<
ref
bean
="
sessionFactory
" />
?
</
property
>
?
</
bean
>
?
</
beans
>
web.xml:
<?xml version="1.0" encoding="UTF-8" ?>
-
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
? <display-name>test</display-name>
-
<servlet>
? <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
? <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
-
<init-param>
? <param-name>contextConfigLocation</param-name>
? <param-value>/WEB-INF/classes/application-*.xml</param-value>
? </init-param>
? <load-on-startup>1</load-on-startup>
? </servlet>
-
<servlet-mapping>
? <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
? <url-pattern>/messagebroker/*</url-pattern>
? </servlet-mapping>
-
<welcome-file-list>
? <welcome-file>index.html</welcome-file>
? <welcome-file>index.htm</welcome-file>
? <welcome-file>index.jsp</welcome-file>
? <welcome-file>default.html</welcome-file>
? <welcome-file>default.htm</welcome-file>
? <welcome-file>default.jsp</welcome-file>
? </welcome-file-list>
-
<!--
for WebSphere deployment,please uncomment
? -->
? </web-app>
源码地址:
http://download.csdn.net/source/3398473
http://download.csdn.net/source/3398594
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |