SSH study notes (a)

Development environment: 1, MyEclipse 6.5

                    2、Tomcat 6.0

                    3、Struts2.0 + Hibernate3.2 + Spring2.0

An operation, before encoding

1. Create a project. In a new MyEclipse Web Project, named mytest, using JavaEE 5 Library. The actual address of the project G: \ workspace \ ssh \ mytest

2, the project will be deployed to tomcat. conf enter tomcat directory under (G: \ apache-tomcat-6.0.30 \ conf), open server.xml, add a line on </ Host>

<Context path="/mytest" docBase="G:\workspace\ssh\mytest\WebRoot" reloadable="true" />

Added to the mapping project

3, the tomcat associated with MyEclipse. In MyEclipse, Window-> Preferences-> MyEclipse Enterprise Workbench-> Servers-> Tomcat-> Tomcat 6.x, set up relevant Tomcat directory. After setting the directory can MyEclipse Tomcat that comes off the disabled. In MyEclipse, Window-> Preferences-> MyEclipse Enterprise Workbench-> Servers-> Integrated Sandbox-> Myeclipse Tomcat6, click disabled.

4, using MyEclipse own import function to integrate. Several steps described later.

5, the selected item mytest, in MyEclipse, myeclipse-> Project Capabilities-> Add Hibernate Capabilities, in the pop-up dialog box, select Hibernate 3.2, "JAR Library Installation" choose "Copy checked Library .....". If you do not choose copy, then there will be class not found when deploying to Tomcat.

6, a step by step next, when the selected database connection, because our little project to manage the use of spring, so do not choose the "Specify database connection detail?", The same token, do not choose "Create SessionFactory calss?". Until the end, it adds support for Hibernate project.

7, the next increase project support for Spring. Select the project mytest, in MyEclipse, myeclipse-> Project Capabilities-> Add Spring Capabilities, in the pop-up dialog box, select Spring 2.0, select the first four Library and Spring2.0 web library ,, "JAR Library Installation" choose "Copy checked Library ..... ".

8, the next pop, no election "Enable AOP builder", will be placed in the designated applicationContext.xml WEB-INF directory, not selected "Create Spring SessionFactory that reference". Until the end, it adds support for Spring projects.

9, add support for Structs manual. Using structs 2.0.11. The (commons-logging-1.0.4.jar this package with a spring, so do not copy) freemarker-2.3.8.jar, ognl-2.6.11.jar, structs2-core-2.0.11.jar, structs2-spring -plugin-2.0.11.jar, xwork-2.0.4.jar copied to the WEB-INF / lib / lower.

10, New structs.xml files in the src directory, enter

<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> </struts>

Project uses Spring to manage, equivalent to action just declared in structs in.
11, the filter was added structs WEB-INF / web.xml. Was added over <welcome-file-list>

<filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.FilterDispatcher </filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>

This will add support of structs.
12, Spring add listener in WEB-INF / web.xml in. Was added over </ web-app>

<listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener>

After doing this you can start tomcat look, should not have any problems.


Until now, the entire project has added support for ssh's a good.

Reproduced in: https: //www.cnblogs.com/moiyer/archive/2011/08/09/2316169.html

Guess you like

Origin blog.csdn.net/weixin_33757609/article/details/94693163