使用myeclipse2014整合ss2h

使用myeclipse2014整合ssh

新建一个webproject 创建过程中注意选择生成web.Xml

 

  1. 先添加struts2的能力

选择都添加过滤器的选项

Core dojo

Dwr spring plugin

 

单击完成

此时在src目录下就生成了struts.xml文件

并且在web.xml文件中配置好了filter

<filter>

<filter-name>struts2</filter-name>

<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>

</filter>

<filter-mapping>

<filter-name>struts2</filter-name>

<url-pattern>/*</url-pattern>

</filter-mapping>

 

  1. 添加spring

    选择默认添加的jar包就可以。

Core facets springweb

 

 

  1. 搭建hibernate

    建立数据的链接

    为了避免乱码问题

    ?userUnicode=true&characterEnchoding=utf-8

     

    取消生成SessionFactory

     

    在applicationContext.xml中添加

        <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>

     

    运行项目 项目运行成功说明整合完毕

原文地址:https://www.cnblogs.com/chengzhipcx/p/4767933.html