• 三大框架整合


    1.加入Spring支持。选择spring,spring web库和spring-persistence库


    2.加入Struts2,struts2 spring


    3.加入Hibernate支持,选择使用spring的配置文件,不创建sessionFactory


    4.在src文件夹下加入log4j.properties


    5.改动web.xml,加入<context-param>和<listener>配置:
     <!-- spring的配置 -->
      <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>

    6.改动struts.xml,加入从对象工厂常量。值为spring,加入一个devMode方便调试
    <constant name="sturts.objectFactory" value="spring"/>
    <constant name="struts.devMode" value="true" />


    7.部署到tomcat,删除反复的8个jar包,剩下70个jar包



    8.假设启动tomcat报内存溢出的错误:
            java.lang.OutOfMemoryError: PermGen space
         -XX:PermSize=256m
         -XX:MaxPermSize=256m
  • 相关阅读:
    centos7 源码安装python3
    gitlab 迁移
    gitlab 搭建
    亚伦史沃茨 公开信
    误删了sudo包怎么办
    在中国历史上,我个人最喜欢的三个皇帝
    安装PHP7
    Mac OS上设置Django开发环境
    The Pragmatic Programmer Quick Reference Guide
    Nginx的第一个模块-HelloWorld
  • 原文地址:https://www.cnblogs.com/yxwkf/p/5275578.html
Copyright © 2020-2023  润新知