ITeye博客

SSH的配置文件【部分】

csdn_zuoqiang · 2010-05-20 14:43 · ssh · 企业架构 · Spring · Struts · SSH · Web · Bean · Markdown

---------spring 中配置hibernateTemplate模板:

<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
  <property name="sessionFactory">
   <ref bean="sessionFactory"></ref>
  </property>
 </bean>

---------spring 中配置实现类:
 <bean id="productdaoimpl" class="org.henry.shop.dao.impl.ProductDAOImpl">
  <property name="hibernateTemplate">
   <ref bean="hibernateTemplate"></ref>
  </property>
 </bean>

 

-----------struts-config.xml中需要添加的配置

<controller
  processorClass="org.springframework.web.struts.DelegatingRequestProcessor">
 </controller>

 <message-resources
  parameter="org.***" />

 <plug-in
  className="org.springframework.web.struts.ContextLoaderPlugIn">
  <set-property property="contextConfigLocation"
   value="/WEB-INF/classes/applicationContext.xml" />
 </plug-in>

 

 

---------web.xml中需要添加的配置
<context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>
   /WEB-INF/classes/applicationContext.xml
  </param-value>
 </context-param>
 <listener>
  <listener-class>
   org.springframework.web.context.ContextLoaderListener
  </listener-class>
 </listener>

 

并修改jar文件,将common-pool.jar加入工程,并将asm-2.2.3.jar删除

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。