Environment:
myeclipse2014
Win10
jdk1.7
Tomcat8
1. Create a WEB project, Filenewweb Project, with the following settings:
finish, new project completed
2. Add Spring, right-click the project name selection: Myeclipseproject Facts [Capabilities]install Spring Facet, as follows:
3. To add hibernate, you first need to create a database connection and then add Hibernate. Here is the example of MySQL
First open the Database Explorer window:
New Connection
After setting it up, click: Test Driver, the tests show successfully:
Next
New successful, can now connect:
You can now open tables and views for the corresponding scenario, and so on:
Add Hibernate, right-click the project name selection: Myeclipseproject Facts [Capabilities]install Hibernate Facet, as follows:
4. Add Struts and right click on Project name selection: Myeclipseproject Facts [Capabilities]install Apache Struts (2.x) Facet, as follows:
SSH Setup Completed:
Publish Web site, Test success:
Maybe we'll use the jar package we downloaded, so we can remove the following jar packages
Create Hibernate.cfg.xml in SRC
The contents are as follows
<?xml version= ' 1.0 ' encoding= ' UTF-8 '? ><! DOCTYPE hibernate-configuration public "-//hibernate/hibernate configuration DTD 3.0//en" "http// Hibernate.sourceforge.net/hibernate-configuration-3.0.dtd "><!--Generated by MyEclipse hibernate Tools. -->
Modify Applicationcontext.xmlThe contents are as follows
<?xml version= "1.0" encoding= "UTF-8"? ><beansxmlns= "Http://www.springframework.org/schema/beans" xmlns: Xsi= "Http://www.w3.org/2001/XMLSchema-instance" xmlns:p= "http://www.springframework.org/schema/p" xsi: schemalocation= "Http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/ Spring-beans-3.1.xsd "><!--indicate the location of hibernate configuration files --><bean id=" sessionfactory " class=" Org.springframework.orm.hibernate3.LocalSessionFactoryBean "> <property name=" configlocation "value=" Classpath:hibernate.cfg.xml "/></bean> </beans>
After this modification, the deployment runs and works correctly
MyEclipse2014 Creating a new Web project and configuring SSH