国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 編程設計 > 正文

使用netbeans搭建jsf+spring框架的方法

2020-07-14 13:26:40
字體:
來源:轉載
供稿:網友

使用netbeans 搭建 JSF+SPRING 框架

spring版本使用4,jsf版本2.2

jsf的配置文件faces-config.xml


復制代碼
代碼如下:

<?xml version='1.0' encoding='UTF-8'?>
<faces-config version="2.0"
xmlns="<a
xmlns:xsi="<a
xsi:schemaLocation="<a >http://java.sun.com/xml/ns/javaee</a> <a >
<application>
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
</application>
</faces-config>

spring配置文件spring-config.xml


復制代碼
代碼如下:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="<a
xmlns:xsi="<a
xmlns:aop="<a
xmlns:c="<a
xmlns:context="<a
xmlns:flow="<a
xmlns:jee="<a
xmlns:jms="<a
xmlns:lang="<a
xmlns:osgi="<a
xmlns:p="<a
xmlns:tx="<a
xmlns:util="<a
xmlns:jpa="<a

xsi:schemaLocation="<a >http://www.springframework.org/schema/beans</a> <a >http://www.springframework.org/schema/beans/spring-beans-4.0.xsd</a>
<a >http://www.springframework.org/schema/aop</a> <a >http://www.springframework.org/schema/aop/spring-aop-4.0.xsd</a>
<a >http://www.springframework.org/schema/context</a> <a >http://www.springframework.org/schema/context/spring-context-4.0.xsd</a>
<a >http://www.springframework.org/schema/webflow-config</a> <a >http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd</a>
<a >http://www.springframework.org/schema/jee</a> <a >http://www.springframework.org/schema/jee/spring-jee-4.0.xsd</a>
<a >http://www.springframework.org/schema/jms</a> <a >http://www.springframework.org/schema/jms/spring-jms-4.0.xsd</a>
<a >http://www.springframework.org/schema/lang</a> <a >http://www.springframework.org/schema/lang/spring-lang-4.0.xsd</a>
<a >http://www.springframework.org/schema/osgi</a> <a >http://www.springframework.org/schema/osgi/spring-osgi-1.2.xsd</a>
<a >http://www.springframework.org/schema/tx</a> <a >http://www.springframework.org/schema/tx/spring-tx-4.0.xsd</a>
<a >http://www.springframework.org/schema/util</a> <a >http://www.springframework.org/schema/util/spring-util-4.0.xsd</a>
<a >http://www.springframework.org/schema/data/jpa</a> <a >http://www.springframework.org/schema/data/jpa/spring-jpa.xsd</a>
">
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
lazy-init="false">
<property name="locations">
<list>
<value>classpath*:jdbc.properties</value>
</list>
</property>
</bean>
<context:annotation-config/>
<context:component-scan base-package="cn.catr.lm.idc" />


<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<!--不使用persistence.xml 做如下配置-->
<property name="packagesToScan" value="cn.catr.lm.idc.po"/>
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"/>
</property>
<property name="jpaProperties">
<props>
<prop key="hibernate.connection.driver_class">${jdbc.driverClassName}</prop>
<prop key="hibernate.connection.url">${jdbc.url}</prop>
<prop key="hibernate.connection.username">${jdbc.username}</prop>
<prop key="hibernate.connection.password">${jdbc.password}</prop>
<prop key="hibernate.c3p0.min_size">10</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
</props>
</property>
</bean>

<!-- 配置事務管理器 -->
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>

<!-- 啟用 annotation事務-->
<tx:annotation-driven transaction-manager="transactionManager"/>

</beans>

jdbc.properties文件


復制代碼
代碼如下:

jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/idc
jdbc.username=root
jdbc.password=111111

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 孝义市| 荣昌县| 昌图县| 盖州市| 博兴县| 平遥县| 泾源县| 齐河县| 溧水县| 容城县| 舒兰市| 莎车县| 柞水县| 叙永县| 左云县| 巴南区| 保德县| 新源县| 丹巴县| 定边县| 青岛市| 江陵县| 甘洛县| 偃师市| 西华县| 五莲县| 辰溪县| 南阳市| 五华县| 信宜市| 浦北县| 岢岚县| 蒙山县| 凤翔县| 湛江市| 南川市| 泰宁县| 长汀县| 博爱县| 武穴市| 宝山区|