zoukankan      html  css  js  c++  java
  • [转载]Spring学习8-用MyEclipse搭建SSH框架 Struts Sp

    1、new一个web project。
    [转载]Spring学习8-用MyEclipse搭建SSH框架 <wbr>Struts <wbr>Sp

    2、右键项目,为项目添加Struts支持。
    [转载]Spring学习8-用MyEclipse搭建SSH框架 <wbr>Struts <wbr>Sp

    [转载]Spring学习8-用MyEclipse搭建SSH框架 <wbr>Struts <wbr>Sp

    [转载]Spring学习8-用MyEclipse搭建SSH框架 <wbr>Struts <wbr>Sp

    点击Finish。src目录下多了struts.xml配置文件。

    [转载]Spring学习8-用MyEclipse搭建SSH框架 <wbr>Struts <wbr>Sp

    3、使用MyEclipse DataBase Explorer建立数据源。
    [转载]Spring学习8-用MyEclipse搭建SSH框架 <wbr>Struts <wbr>Sp
    new一个数据源。填入数据源信息。
    [转载]Spring学习8-用MyEclipse搭建SSH框架 <wbr>Struts <wbr>Sp

    点击test Driver,如果成功显示:点击OK,点击Finish。
    4、为项目添加Spring支持。
    [转载]Spring学习8-用MyEclipse搭建SSH框架 <wbr>Struts <wbr>Sp

    选择五个包,之后JAR Library Installation为如下图。

    [转载]Spring学习8-用MyEclipse搭建SSH框架 <wbr>Struts <wbr>Sp

    点击Next。[转载]Spring学习8-用MyEclipse搭建SSH框架 <wbr>Struts <wbr>Sp

    默认点击Finish。

    5、为项目添加Hibernate支持。


    [转载]Spring学习8-用MyEclipse搭建SSH框架 <wbr>Struts <wbr>Sp

    [转载]Spring学习8-用MyEclipse搭建SSH框架 <wbr>Struts <wbr>Sp

    默认的包,更改JAR Library Installation。

    点击Next。


    [转载]Spring学习8-用MyEclipse搭建SSH框架 <wbr>Struts <wbr>Sp

    选择是建立Hibernate自己的配置文件,还是合并到Spring的配置文件。选择合并,即更改点选框,点击Next。


    [转载]Spring学习8-用MyEclipse搭建SSH框架 <wbr>Struts <wbr>Sp

    选择Existing Spring Configration File,点击Next。


    [转载]Spring学习8-用MyEclipse搭建SSH框架 <wbr>Struts <wbr>Sp
    选择我们刚刚创建的数据源。点击Next。

    [转载]Spring学习8-用MyEclipse搭建SSH框架 <wbr>Struts <wbr>Sp

    去掉复选框的勾勾,点击Finish。

    6、发布项目,此时已经可以访问这个项目的jsp页面了。

    [转载]Spring学习8-用MyEclipse搭建SSH框架 <wbr>Struts <wbr>Sp

    7、后续工作。

    在web.xml里面加入spring配置与监听如下。

    <!-- Spring配置和监听start -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/classes/application*.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <!—end -->


  • 相关阅读:
    [IOI2013]Dreaming
    Lost Cows
    Mobile Service
    [POI2005]Bank notes
    [CTSC2007]动物园zoo
    [CF1093F]Vasya and Array
    [雅礼集训 2017 Day1]市场
    [APIO2014]序列分割
    [CEOI2004]锯木厂选址
    [APIO2010]特别行动队
  • 原文地址:https://www.cnblogs.com/liuzhuqing/p/7480403.html
Copyright © 2011-2022 走看看