spring 基于注解的 配置

gfghgi 2009-12-12 06:01:46
现有项目是 在 eclipse 中 ,
已实现了 spring mvc 注解的配置 ,,
数据方面是 jdbc

现我想加入 jpa 用hibernater

如何配置呢 ,?

<?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:p="http://www.springframework.org/schema/p"
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/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">



<context:annotation-config />
<aop:aspectj-autoproxy />

<bean id="placeholderConfig" class="com.yht.ipcentrex.filter.SystemPropertiesLoader">

</bean>

<bean id="dataSource" class="org.postgresql.jdbc3.Jdbc3PoolingDataSource"
scope="singleton">
<property name="dataSourceName" value="${db.dataSourceName}" />
<property name="serverName" value="192.168.1.105" />
<property name="databaseName" value="${db.databaseName}" />
<property name="user" value="${db.user}" />
<property name="password" value="${db.password}" />
<property name="portNumber" value="${db.portNumber}" />
<property name="maxConnections" value="${db.maxConnections}" />
</bean>

<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource">
<ref bean="dataSource" />
</property>
</bean>

<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">

<property name="basenames">
<list>
<value>com/yht/ipcentrex/i18n/message
</value>
<value>com/yht/ipcentrex/i18n/adminViews
</value>
<value>com/yht/ipcentrex/i18n/resellerViews
</value>
<value>com/yht/ipcentrex/i18n/accountViews
</value>
<value>com/yht/ipcentrex/i18n/agentViews
</value>
<value>com/yht/ipcentrex/i18n/utilViews
</value>
</list>
</property>

</bean>

<bean id="abstractDao" class="com.yht.ipcentrex.dao.AbstractDao"
abstract="true">
<property name="jdbcTemplate">
<ref bean="jdbcTemplate" />
</property>
</bean>

<!-- <bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">-->
<!-- <property name="dataSource" ref="dataSource"/>-->
<!-- </bean>-->


<!--conifg active mq-->
<bean id="connectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="${mq.host}" />
</bean>
</property>
</bean>

<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate" scope="prototype">
<property name="connectionFactory" ref="connectionFactory" />
</bean>


<!-- send mail -->

<bean id="emailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl" scope="prototype">
<property name="host" value="${mail.host}"/>
<property name="port" value="465"/>
<property name="username" value="${mail.userName}" />
<property name="password" value="${mail.password}"/>
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.auth">true</prop>
</props>
</property>
</bean>


<!-- time scheduler-->
<bean id="jobBean" class="com.yht.ipcentrex.time.Job" />

<bean name="exampleJob" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="com.yht.ipcentrex.time.ExampleJob" />
<property name="jobDataAsMap">
<map>
<entry key="timeout" value="5" />
</map>
</property>
</bean>

<bean id="job"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="jobBean" />
<property name="targetMethod" value="execute" />
<property name="concurrent" value="false" />
</bean>

<bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="exampleJob" />
<property name="cronExpression" value="0 48 10 * * ?" />
</bean>

<bean id="simpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
<property name="jobDetail" ref="job" />
<property name="startDelay" value="10000" />
<property name="repeatInterval" value="10000" />
</bean>












<bean
class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" autowire="default" />

<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">

<property name="showSql" value="true" />
</bean>
</property>


<property name="jpaProperties">
<props>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="provider">org.hibernate.ejb.HibernatePersistence</prop>
</props>
</property>

<property name="loadTimeWeaver" >
<bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver"/>
</property>
</bean>

<bean id="txManager" class="org.springframework.orm.jpa.JpaTransactionManager">

<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<tx:annotation-driven transaction-manager="txManager" />
</beans>











spring-servlet.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:p="http://www.springframework.org/schema/p"
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/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">

<context:annotation-config />

<context:component-scan base-package="com.yht.ipcentrex.*" />
<bean
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />




<bean name="viewResolver1"
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:suffix=".jsp" />


<!--
<bean id="beanNameViewResolver"
class="org.springframework.web.servlet.view.BeanNameViewResolver">
<property name="order" value="1" /> </bean>
-->
<bean name="viewResolver" class="org.springframework.web.servlet.view.XmlViewResolver">
<property name="order" value="1" />
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="cronTrigger" />
<ref bean="simpleTrigger" />
</list>
</property>
</bean>

<bean id="themeSource"
class="org.springframework.ui.context.support.ResourceBundleThemeSource">
<property name="basenamePrefix" value="themes/" />
</bean>
<bean id="themeResolver"
class="org.springframework.web.servlet.theme.SessionThemeResolver">
<property name="defaultThemeName">
<value>yellow</value>
</property>
</bean>




<aop:config>
<aop:aspect id="controlAspect" ref="controlAspectBean">
<!--配置com.spring.service包下所有类或接口的所有方法-->
<aop:pointcut id="businessService" expression="execution(* com.yht.ipcentrex.control..*.*(..))" />
<aop:before pointcut-ref="businessService" method="doBefore"/>
<aop:after pointcut-ref="businessService" method="doAfter"/>
<aop:around pointcut-ref="businessService" method="doAround"/>
<aop:after-throwing pointcut-ref="businessService" method="doThrowing" throwing="ex"/>
</aop:aspect>
</aop:config>

<!--
<aop:config>
<aop:aspect id="jdbcAspect" ref="jdbcAspectBean">
<aop:pointcut id="jdbcDao" expression="execution(* com.yht.ipcentrex.dao..*.*(..))" />
<aop:after pointcut-ref="jdbcDao" method="doAfter"/>
</aop:aspect>
</aop:config>
-->
<tx:advice id="txAdvice" transaction-manager="txManager">

<tx:attributes>
<tx:method name="*" propagation="REQUIRED" rollback-for="Exception"/>
</tx:attributes>

</tx:advice>


<aop:config>
<aop:pointcut id="serviceOperation" expression="execution(* com.yht.ipcentrex.service.*.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="serviceOperation"/>
</aop:config>

</beans>
...全文
857 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
gfghgi 2009-12-15
  • 打赏
  • 举报
回复
搞定~
howsun_zh 2009-12-15
  • 打赏
  • 举报
回复
<property name="packagesToScan"> 
<list>
<value> com.yht.ipcentrex.control.* </value>
</list>
</property>


com.yht.ipcentrex.control.* 这句不用*,例如你有如下实体:

com.yht.ipcentrex.control.SystemConfig
com.yht.ipcentrex.control.user.User
com.yht.ipcentrex.control.user.UserInfo
com.yht.ipcentrex.control.product.Product
com.yht.ipcentrex.control.product.Category


则这样配置:
<property name="packagesToScan">
<list>
<value>com.yht.ipcentrex.control</value>
<value>com.yht.ipcentrex.control.user</value>
<value>com.yht.ipcentrex.control.product</value>
</list>
</property>


另外加上ejb3-persistence.jar这个包,所有的注解都用这个包里的。
gfghgi 2009-12-14
  • 打赏
  • 举报
回复
按楼上的方法配置 大致可行,,现在
我尝试 和 jdbcTemplate 混合使用(项目原因),,

@Component
public class mytest extends HibernateDaoSupport {

@Autowired
public void setSessionFactory0(SessionFactory sessionFactory){
super.setSessionFactory(sessionFactory);
}
}

@Component
public class my_dao extends mytest {

public void save() {
System.out.println("now is start .......");
Person p = new Person(6, "11", 11, "11");
getHibernateTemplate().save(p);
}
}




import org.hibernate.annotations.Entity;
import org.hibernate.annotations.*;
@Entity
public class Person implements Serializable {

@Id
// @GeneratedValue(strategy = GenerationType.AUTO)
private int id;
private String name;
private int age;
private String address;

运行时,
提示错误:
Unknown entity??
gfghgi 2009-12-14
  • 打赏
  • 举报
回复
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:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
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-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
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">



<context:annotation-config />
<aop:aspectj-autoproxy />

<bean id="placeholderConfig" class="com.yht.ipcentrex.filter.SystemPropertiesLoader">

</bean>

<bean id="dataSource" class="org.postgresql.jdbc3.Jdbc3PoolingDataSource"
scope="singleton">
<property name="dataSourceName" value="${db.dataSourceName}" />
<property name="serverName" value="192.168.1.105" />
<property name="databaseName" value="${db.databaseName}" />
<property name="user" value="${db.user}" />
<property name="password" value="${db.password}" />
<property name="portNumber" value="${db.portNumber}" />
<property name="maxConnections" value="${db.maxConnections}" />
</bean>




<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource">
<ref bean="dataSource" />
</property>
</bean>

<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">

<property name="basenames">
<list>
<value>com/yht/ipcentrex/i18n/message
</value>
<value>com/yht/ipcentrex/i18n/adminViews
</value>
<value>com/yht/ipcentrex/i18n/resellerViews
</value>
<value>com/yht/ipcentrex/i18n/accountViews
</value>
<value>com/yht/ipcentrex/i18n/agentViews
</value>
<value>com/yht/ipcentrex/i18n/utilViews
</value>
</list>
</property>

</bean>

<bean id="abstractDao" class="com.yht.ipcentrex.dao.AbstractDao"
abstract="true">
<property name="jdbcTemplate">
<ref bean="jdbcTemplate" />
</property>
</bean>

<!-- <bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">-->
<!-- <property name="dataSource" ref="dataSource"/>-->
<!-- </bean>-->


<!--conifg active mq-->
<bean id="connectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="${mq.host}" />
</bean>
</property>
</bean>

<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate" scope="prototype">
<property name="connectionFactory" ref="connectionFactory" />
</bean>


<!-- send mail -->

<bean id="emailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl" scope="prototype">
<property name="host" value="${mail.host}"/>
<property name="port" value="465"/>
<property name="username" value="${mail.userName}" />
<property name="password" value="${mail.password}"/>
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.auth">true</prop>
</props>
</property>
</bean>


<!-- time scheduler-->
<bean id="jobBean" class="com.yht.ipcentrex.time.Job" />

<bean name="exampleJob" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="com.yht.ipcentrex.time.ExampleJob" />
<property name="jobDataAsMap">
<map>
<entry key="timeout" value="5" />
</map>
</property>
</bean>

<bean id="job"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="jobBean" />
<property name="targetMethod" value="execute" />
<property name="concurrent" value="false" />
</bean>

<bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="exampleJob" />
<property name="cronExpression" value="0 48 10 * * ?" />
</bean>

<bean id="simpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
<property name="jobDetail" ref="job" />
<property name="startDelay" value="10000" />
<property name="repeatInterval" value="10000" />
</bean>










<bean
class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" autowire="default" />


<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="packagesToScan"><!-- 实体所在的包,能自动扫描实体的注解配置 -->
<list>
<value> com.yht.ipcentrex.control.*</value>

</list>
</property>

<!-- Hibernate配置 -->
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect.">org.hibernate.dialect.PostgreSQLDialect</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
<!--hibernate属性很多,需查看其手册-->
</props>
</property>
</bean>
<!-- 配置事务管理器 -->
<bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory"/>
</property>
</bean>
</beans>





spring-sevlet.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:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
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-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
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">



<context:component-scan base-package="com.yht.ipcentrex.*" />
<bean
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />




<bean name="viewResolver1"
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:suffix=".jsp" />


<!--
<bean id="beanNameViewResolver"
class="org.springframework.web.servlet.view.BeanNameViewResolver">
<property name="order" value="1" /> </bean>
-->
<bean name="viewResolver" class="org.springframework.web.servlet.view.XmlViewResolver">
<property name="order" value="1" />
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="cronTrigger" />
<ref bean="simpleTrigger" />
</list>
</property>
</bean>

<bean id="themeSource"
class="org.springframework.ui.context.support.ResourceBundleThemeSource">
<property name="basenamePrefix" value="themes/" />
</bean>
<bean id="themeResolver"
class="org.springframework.web.servlet.theme.SessionThemeResolver">
<property name="defaultThemeName">
<value>yellow</value>
</property>
</bean>




<aop:config>
<aop:aspect id="controlAspect" ref="controlAspectBean">
<!--配置com.spring.service包下所有类或接口的所有方法-->
<aop:pointcut id="businessService" expression="execution(* com.yht.ipcentrex.control..*.*(..))" />
<aop:before pointcut-ref="businessService" method="doBefore"/>
<aop:after pointcut-ref="businessService" method="doAfter"/>
<aop:around pointcut-ref="businessService" method="doAround"/>
<aop:after-throwing pointcut-ref="businessService" method="doThrowing" throwing="ex"/>
</aop:aspect>
</aop:config>

<!--
<aop:config>
<aop:aspect id="jdbcAspect" ref="jdbcAspectBean">
<aop:pointcut id="jdbcDao" expression="execution(* com.yht.ipcentrex.dao..*.*(..))" />
<aop:after pointcut-ref="jdbcDao" method="doAfter"/>
</aop:aspect>
</aop:config>
-->
<tx:advice id="txAdvice" transaction-manager="txManager">

<tx:attributes>
<tx:method name="*" propagation="REQUIRED" rollback-for="Exception"/>
</tx:attributes>

</tx:advice>


<aop:config>
<aop:pointcut id="serviceOperation" expression="execution(* com.yht.ipcentrex.service.*.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="serviceOperation"/>
</aop:config>

</beans>
howsun_zh 2009-12-14
  • 打赏
  • 举报
回复
@Entity用ebj3.0标准,即ejb3-persistence.jar中的(绝对大部分注解都用这个包中的)

貌似你的配置还有问题,最好贴出来看看。
howsun_zh 2009-12-13
  • 打赏
  • 举报
回复
看楼主用了JPA实体管理,大致说明实体类用的是注解配置方式。如果用纯Hibernate框架来管理持久层,需要如下步骤:
1、保留dataSource。去掉jdbcTemplate和entityManagerFactory。
2、增加Hibernate的sessionFactory
sessionFactory的注入代码示例:

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="packagesToScan"><!-- 实体所在的包,能自动扫描实体的注解配置 -->
<list>
<!-- value>com.xxx.domain</value> -->
</list>
</property>

<!-- Hibernate配置 -->
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect"><!--方言--></prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.format_sql">false</prop>
<!--hibernate属性很多,需查看其手册-->
</props>
</property>
</bean>

3、使用:
在DAO层从容器取得sessionFactory,就可以得到Hibernate的Session
chiboo 2009-12-12
  • 打赏
  • 举报
回复
你这样配置,配置文件的代码容量的确很庞大。看了一部分,你是不是把bean的属性字段都配置到sping里了?如果是这样的话,可以用hibernate的类.hbm.xml来配置bean的。并把它们加入到spring 的配置文件来。比如:
<property name="mappingResources">
<!-- 映射的文件 -->
<list>
<value>org/cric/bboa/model/systemSet/Department.hbm.xml</value>
<value>org/cric/bboa/model/manpowerResource/DirectFamily.hbm.xml</value>


</list>
</property>
longtenggdf 2009-12-12
  • 打赏
  • 举报
回复
spring 也可以通过自动扫描和注解 来管理bean.详细请看 spring annotation;
qianl828 2009-12-12
  • 打赏
  • 举报
回复
路过 ...
fskjb01 2009-12-12
  • 打赏
  • 举报
回复
hibernate的注解和Sping的注解是两码事啊。
第1章:对Spring框架进行宏观性的概述,力图使读者建立起对Spring整体性的认识。   第2章:通过一个简单的例子展现开发Spring Web应用的整体过程,通过这个实例,读者可以快速跨入Spring Web应用的世界。   第3章:讲解Spring IoC容器的知识,通过具体的实例详细地讲解IoC概念。同时,对Spring框架的三个最重要的框架级接口进行了剖析,并对Bean的生命周期进行讲解。   第4章:讲解如何在Spring配置文件中使用Spring 3.0的Schema格式配置Bean的内容,并对各个配置项的意义进行了深入的说明。   第5章:对Spring容器进行解构,从内部探究Spring容器的体系结构和运行流程。此外,我们还将对Spring容器一些高级主题进行深入的阐述。   第6章:我们从Spring AOP的底层实现技术入手,一步步深入到Spring AOP的内核中,分析它的底层结构和具体实现。   第7章:对如何使用基于AspectJ配置AOP的知识进行了深入的分析,这包括使用XML Schema配置文件、使用注解进行配置等内容。   第8章:介绍了Spring所提供的DAO封装层,这包括Spring DAO的异常体系、数据访问模板等内容。   第9章:介绍了Spring事务管理的工作机制,通过XML、注解等方式进行事务管理配置,同时还讲解了JTA事务配置知识。   第10章:对实际应用中Spring事务管理各种疑难问题进行透彻的剖析,让读者对Spring事务管理不再有云遮雾罩的感觉。   第11章:讲解了如何使用Spring JDBC进行数据访问操作,我们还重点讲述了LOB字段处理、主键产生和获取等难点知识。   第12章:讲解了如何在Spring中集成Hibernate、myBatis等数据访问框架,同时,读者还将学习到ORM框架的混用和DAO层设计的知识。   第13章:本章重点对在Spring中如何使用Quartz进行任务调度进行了讲解,同时还涉及了使用JDK Timer和JDK 5.0执行器的知识。   第14章:介绍Spring 3.0新增的OXM模块,同时对XML技术进行了整体的了解。   第15章:对Spring MVC框架进行详细介绍,对REST风格编程方式进行重点讲解,同时还对Spring 3.0的校验和格式化框架如果和Spring MVC整合进行讲解。   第16章:有别于一般书籍的单元测试内容,本书以当前最具实战的JUnit4+Unitils+ Mockito复合测试框架对如何测试数据库、Web的应用进行了深入的讲解。   第17章:以一个实际的项目为蓝本,带领读者从项目需求分析、项目设计、代码开发、单元测试直到应用部署经历整个实际项目的整体开发过程。

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧