`
everlxq
  • 浏览: 103256 次
  • 性别: Icon_minigender_1
  • 来自: 青岛
社区版块
存档分类
最新评论

SSH环境

 
阅读更多
struts 配置 error filter

struts配置  1:jar包


commons-fileupload-1.2.1.jar 、 commons-logging-1.0.4.jar 、 freemarker-2.3.15.jar 、 log4j-1.2.15.jar 、 ognl-2.7.3.jar 、 struts2-core-2.1.8.1.jar 、 xwork-core-    2.1.6.jar


2:struts.xml 


3:web.xml

出错想想都需要哪些配置,挨个排查,这次的错误在于struts初始化了log4j,log4j.properties写错了!


hibernate

1:jar包

2:hibernate.cfg.xml 以及实体类

web.xml中无需配置


Spring

1.jar包

2.applicationContext.xml中

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation" value="classpath:hibernate.cfg.xml"></property>
</bean>

    <bean id="hibernateDaoSupport" abstract="true">
<property name="sessionFactory" ref="sessionFactory"></property>
<!-- <property name="hibernateLog" ref="hibernateLog"></property> -->
</bean>
<!-- sys start -->
<bean id="test" class="test.TestStrutsAction" parent="hibernateDaoSupport"/>

给hibernateDao注入huberbateDaoSupport   以及注入类的实例

3.web.xml

a:<context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>classpath:applicationContext.xml</param-value>
  </context-param>

b:<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext-*.xml</param-value>
</context-param>
说明applicationContext.xml文件的位置

  <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

启动spring
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics