I. Deployment in MyEclipse software
1, in MyEclipse, after the creation of the project, in the MyEclipse menu bar, select Windows-Preferences-MyEclipse, TOMCAT5, select "Enable"; Tomact Home Directory to select the directories that Tomcat installs on your machine. Then, Tomcat5->jdk, MyEclipse, Preferences, Windows, and so on, make sure that there is a corresponding JDK version, and if not, add its installation path via "add". Ok
2. Select the button on the toolbar, select the project you want to deploy in project, then "Add" and select "Tomcat", Finish.
3. Select on the toolbar to start Tomcat.
4, run the program. Enter http://localhost:8080/aa/WebRoot/index.jsp (AA is the project name) in IE
Ii. deployment in Tomcat's server.xml configuration file
1. Under Tomcat, locate the Server.xml under the Conf file and open it.
2. Add the following code between <Host> and
1
2 <context path= "/virtual directory Name" docbase= "Destination directory location" debug= "0" reloadable= "true" >
3 </Context>
(Strictly case-sensitive, when path= "", this time the virtual directory is directly rooted--->http://localhost:8080/)
Parameters:
Path: Indicates that the http://localhost:8080/virtual directory name is entered in the browser
DocBase: Represents the physical absolute path of your package, the default absolute path is%tomcat_home%/webapps
Reloadable: True, Tomcat automatically detects changes in the application's/web-inf/lib and/web-inf/classes directories, automatically loads new applications, and we can change the application without having to restart Tomcat ; False to not load automatically.
(I think this deployment method is good here, so you don't have to restart Tomcat.) It is not known where the previous method is configured to achieve the same effect. If there is, please expert guidance! )
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 under Tomcat, locate the Startup.bat under the bin file and open it for startup.
4, run the program. Enter http://localhost/wess/index.jsp in IE address (when referencing the example configuration above)
Report:
In the Lib Struts-config.xml can add the following three sentences to the default configuration of the home page, that is, in IE, just enter the home page in the directory, rather than write the page. As the above configuration, you can enter only http://localhost/wess
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
Two ways to deploy Tomcat in MyEclipse