内容发布更新时间 : 2024/11/1 6:50:04星期一 下面是文章的全部内容请认真阅读。
Eclipse搭建SSH(Struts2.5.10+Spring4.3.7+Hibernate5.2.9)
目录
1. 下载struts相关jar包,下载地址http://struts.apache.org/download.cgi#struts25101 ........ 1 2. 下载spring相关jar包,下载地址https://spring.io/projects .................................................. 2 3. 下载hibernate相关jar包,下载地址http://hibernate.org/orm/downloads/ ....................... 6 4. eclipse操作 .................................................................................................................................. 7
4.1 新建名为exam的工程 ................................................................................................ 7 4.2 复制struts所需jar包 ................................................................................................. 9 4.3 修改struts.xml ............................................................................................................ 11 4.4 复制spring所需jar包............................................................................................... 12 4.5 修改web.xml .............................................................................................................. 13 4.6 在src目录下新建applicationContext.xml ................................................................ 14 4.7 修改struts.xml文件 ................................................................................................... 14 4.8 Hibernate的搭建........................................................................................................ 14 4.9 修改applicationContext.xml文件 ............................................................................. 15 4.10 在实体类的目录下新建一个实体类.hbm.xml的文件并编辑 ............................. 16 4.11 配置build path ....................................................................................................... 16 4.12 在WEB-INF下新建Register.jsp和Success.jsp ..................................................... 18 5. 相关JAVA代码 .......................................................................................................................... 18
5.1 action层...................................................................................................................... 18 5.2 bean实体.................................................................................................................... 19 5.3 service层 .................................................................................................................... 20 5.4 dao层 ......................................................................................................................... 21 6. 数据库 ....................................................................................................................................... 22
6.1 下载mysql地址https://dev.mysql.com/downloads/mysql/ .................................... 22 6.2 数据库脚本 ................................................................................................................. 23
1. 下载struts相关jar包,下载地址http://struts.apache.org/download.cgi#struts25101
2. 下载spring相关jar包,下载地址https://spring.io/projects
点击SPRING FRAMEDWORK 进入下图所示
点击“the Modules of the reference…”,进入如下图所示