zoukankan      html  css  js  c++  java
  • 重温SSH整合项目

    1.由spring处理的路径就可以带classpath:

    2.在<tx:advice id="advice" transaction-manager="transactionManager">中别忘加transactionManager,不加也会自动带

    3.页面上提示no Session 时的处理方式:

      01.在hbm.xml配置文件中lazy为false

      02.在dao中执行查询时使用迫切左外连接

      03.使用OpenSessionInViewFilter(使用OpenSessionInViewFilter也会出现原来没有的错误,比如说用户修改的时候)

        具体使用方法:①导入spring的一个jar包

               ②在web.xml中配置如下即可。

        <filter>
            <filter-name>OpenSessionInViewFilter</filter-name>
            <filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>
        </filter>
        <filter-mapping>
            <filter-name>OpenSessionInViewFilter</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>

                注意:以上这段配置不能放在struts2拦截器配置的下面

    4.action,service,dao以及struts.xml中最好分别以处理的对象区分开来

    5.在hbm.xml中配置时最好不要带fetch="join"而在dao中自己加

    6.若表单项的disabled属性为true那么这一项就不会提交

  • 相关阅读:
    数据库之小问题
    网络基础
    react-fiber 解析
    【like-react】手写一个类似 react 的框架
    istat menus 序列号
    Git学习
    JavaScript设计模式与开发实践【第一部分】
    javascript 原生bind方法实现
    requirejs 学习
    mac 安装maven+eclipse
  • 原文地址:https://www.cnblogs.com/feifeiyun/p/6814929.html
Copyright © 2011-2022 走看看