1. Deploy in Myeclipse
1. In Myeclipse, after creating a project, select Windows> Preferences> Myeclipse> Tomcat5 in the Myeclipse menu bar and select "Enable "; tomact Home Directory select the Directory where Tomcat is installed on your machine. Then, choose Windows> Preferences> Myeclipse> Tomcat5> JDK to ensure that the jdk version is available. If not, Add the installation path through "Add. OK
2. Select the button on the toolbar, select the Project you want to deploy in "Project", click "Add", select "Tomcat", and Finish.
3. select on the toolbar to start Tomcat.
4. Run the program. Enter http: // localhost: 8080/aa/WebRoot/index. jsp in IE (aa indicates the project name)
2. Deploy the service in the Tomcat server. xml configuration file
1. In Tomcat, locate server. xml in the conf file and open it.
2. Add the following code between <Host> and 1
2 <Context path = "/virtual directory name" docBase = "target directory location" debug = "0" reloadable = "true">
3 </Context>
(Case sensitive. When path = "", the virtual directory is root ---> http: // localhost: 8080 /)
Parameters:
Path: Enter http: // localhost: 8080/virtual directory name in the browser
DocBase: indicates the physical absolute path of your package. The default absolute path is % tomcat_home %/webapps.
Reloadable: true, tomcat will automatically detect changes to the/WEB-INF/lib and/WEB-INF/classes directories of the application, automatically load the new application, we can change the application without restarting tomcat; if it is false, it will not be loaded automatically.
(I think this deployment method is good here, so you don't have to restart Tomcat. I don't know where the previous method was configured to achieve the same effect. If yes, please kindly advise !)
Example:
1
2 1 <! -- My custom directory -->
3 2 <Context path = "/wess" debug = "0" docBase = "C: \ Documents and Settings \ tt \ workspace \ Welcome_SS \ WebRoot" reloadable = "true">
4 3 </Context>
5 4
3. start Tomcat
On the Myeclipse toolbar, select to start Tomcat. Or in Tomcat, find startup. bat in the binfile and start it.
4. Run the program. Enter http: // localhost/wess/index. jsp In the IE address (refer to the configuration example above)
Appendix:
The struts-config.xml under lib can add the following three statements for the default home page configuration, that is, in IE, you only need to enter the home page Directory, without having to write the home page. In the preceding configuration, you can only enter http: // localhost/wess.
<Welcome-file-list>
<Welcome-file> index. jsp </welcome-file>
</Welcome-file-list>