`
dyllove98
  • 浏览: 1382049 次
  • 性别: Icon_minigender_1
  • 来自: 济南
博客专栏
73a48ce3-d397-3b94-9f5d-49eb2ab017ab
Eclipse Rcp/R...
浏览量:38325
4322ac12-0ba9-3ac3-a3cf-b2f587fdfd3f
项目管理checkList...
浏览量:78632
4fb6ad91-52a6-307a-9e4f-816b4a7ce416
哲理故事与管理之道
浏览量:131767
社区版块
存档分类
最新评论

MyEclipse搭建SSH框架 Struts2.1+Spring3.0+hibernate3.3

 
阅读更多

用MyEclipse搭建SSH框架 Struts2.1+Spring3.0+hibernate3.3

1、         配置Tomcat

配置Tomcat所在路径

配置Tomcat使用JDK版本

如果Tomcat为7.0则添加Tomcat-juli.jar包

2、         new一个web project。

2、右键项目,为项目添加Struts支持。

 

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

 

3、使用MyEclipse DataBase Explorer建立数据源。

 

new一个数据源。填入数据源信息。

jdbc:Oracle:thin:@localhost(数据库所在服务器):1521(默认端口):orcl11(数据库名称)

 

点击test Driver,如果成功显示:

 

点击OK,点击Finish。

4、为项目添加Spring支持。

 

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

 

点击Next。

 

默认点击Finish。

5、为项目添加Hibernate支持。

  

默认的包,更改JAR Library Installation。

点击Next。

 

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

 

选择Existing Spring Configration File,点击Next。

 

选择我们刚刚创建的数据源。点击Next。

 

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

6、在配置Tomcat路径下的 server.xml

 

在Host节点下添加:

<Context path="/Test" docBase="D:\Java\Struts2.1+Spring3.0+hibernate3.3\WebRoot" debug="0" privileged="true"></Context>

7、错误处理:

严重: Exception starting filter struts2

java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

用户文件夹

\AppData\Local\Genuitec\MyEclipse 8.5\configuration\org.eclipse.osgi\bundles\105\1\.cp\data\2.1\core

Struts2所有Jar包复制到项目下的WEB-INF/lib文件夹里。

 

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

 

9、后续工作。

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

8、结束。

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics