zoukankan      html  css  js  c++  java
  • ssh框架搭建错误集合

    1,把jsp放入到WEB-INF/view目录下,struts2.xml配置<result name="success">/WEB-INF/view/home.jsp</result>,访问404的原因?

    解决方法:http://www.cnblogs.com/dynasty/archive/2012/07/21/2601955.html
    要添加struts2-convention-plugin(在struts2/lib目录下有)插件,同时此插件依赖asm-commons-3.3.jar,asm-3.3.jar和asm-tree-3.3.jar。
    详情在http://www.cnblogs.com/freeabyss/p/3325252.html

    在struts2.xml配置 <struts> 节点内配置<constant name="struts.convention.result.path" value="/WEB-INF/view/" />

    2,在UserDaoHibernate中使用 getSessionFactory().getCurrentSession()出现 Could not obtain transaction-synchronized Session for current thread 错误?
    解决办法:受这篇文章http://www.cnphp6.com/archives/112574启发,在applicationContext.xml配置
    <bean id="transactionManager"
    class="org.springframework.orm.hibernate4.HibernateTransactionManager">
    <property name="sessionFactory">
    <ref bean="sessionFactory" />
    </property>
    </bean>
    <tx:annotation-driven transaction-manager="transactionManager"/>
    在UserDaoHibernate类上加注解@Transactional,解决问题。

  • 相关阅读:
    常见HTTP状态码
    Spring MVC 原理小结
    RESTful API
    java:IO流学习小结
    理解 Statement 和 PreparedStatement
    Hibernate缓存原理与策略
    APP运营
    网站常见术语
    php常见术语
    运维------术语名词
  • 原文地址:https://www.cnblogs.com/Bonker/p/5670604.html
Copyright © 2011-2022 走看看