您的位置:首页 > 编程语言 > Java开发

struts2+hibernate整合开发步骤

2016-09-10 20:20 295 查看

百度的各种代码,步骤,自己整合了一下

 

1,创建数据库

  常用mysql   creat table.....

2,在WebContent下的bin中添加相应的包

  http://pan.baidu.com/s/1c2DR2co

    本人的百度云盘分享

3,创建实体类以及相应的映射文件、

  例如stuinfo.java和stuinfo.hbm.xml

  stuinfo.java中包含,私有成员对象和getter,setter方法

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<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>

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
View Code

 

7,编写显示界面jsp文件

 

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: