欢迎来到天天文库
浏览记录
ID:6129326
大小:1.07 MB
页数:25页
时间:2018-01-04
《struts2+spring+hibernate3.3增删改查的实例图文详解(i)》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、使用myeclipse8.6和sqlserver2005数据库第一步创建javaweb项目s2sh5,如下图Ctrl+N点击Next接着点击Finish第二步添加struts2,spring支持添加struts2支持选择struts2点击完成添加spring支持选择五个选项点击下一步在两个方框中打钩,点击完成第三步添加数据库连接点击红色方框MyeclipseDatabaseExplore点击红色方框New选择数据库,命名databasedriver,服务器端口号以及数据库用户和密码,测试数据库是否连接成功测试点击ok,接着点击Next点击Finish第四步添加hibernate支持点击红色方
2、框打钩,Next点击Next选中红色方框打钩,点击Next选择下拉列表中的bj1点击Next点击Finish点击Source删除后点击web.xml第四步在web.xml中配置监听器和context-param3、/ns/javaeehttp://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">org.springframework.web.context.ContextLoaderListenercontextConfigLocationclasspath:applicationContext.xml4、aram>index.jspstruts2org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilterstruts2*.act5、ion第五步在index.jsp页面里添加随便添加一些文字<%@pagelanguage="java"import="java.util.*"contentType="text/html;charset=gbk"%><%Stringpath=request.getContextPath();StringbasePath=request.getScheme()+"://"+request.ge6、tServerName()+":"+request.getServerPort()+path+"/";%>">MyJSP'index.jsp'startingpage7、="expires"content="0"><
3、/ns/javaeehttp://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">org.springframework.web.context.ContextLoaderListenercontextConfigLocationclasspath:applicationContext.xml4、aram>index.jspstruts2org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilterstruts2*.act5、ion第五步在index.jsp页面里添加随便添加一些文字<%@pagelanguage="java"import="java.util.*"contentType="text/html;charset=gbk"%><%Stringpath=request.getContextPath();StringbasePath=request.getScheme()+"://"+request.ge6、tServerName()+":"+request.getServerPort()+path+"/";%>">MyJSP'index.jsp'startingpage7、="expires"content="0"><
4、aram>index.jspstruts2org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilterstruts2*.act
5、ion第五步在index.jsp页面里添加随便添加一些文字<%@pagelanguage="java"import="java.util.*"contentType="text/html;charset=gbk"%><%Stringpath=request.getContextPath();StringbasePath=request.getScheme()+"://"+request.ge
6、tServerName()+":"+request.getServerPort()+path+"/";%>
7、="expires"content="0"><
此文档下载收益归作者所有