All Java programmers, when writing web programs, typically write a Web Project through tools such as MyEclipse, and use tools to associate the Web program with Tomcat. In fact, we can deploy to the Tomcat server through the Java program, we need to start manually to modify.
When we create a Java project, we have to pay attention to the structure of the Web program on Tomcat, all of which require us to manually modify Java project into a web format, such as:
The packages required for the project are imported into Lib under Web-inf.
Then it needs to be configured in Tomcat. You need to create a new Catalina directory under the Conf directory of Tomcat, create a new localhost directory under the Catalina directory,
Then in the localhost directory, create a new XML file, such as Demo.xml, add <context docbase= "D:\workspace\Java proecjt\webroot" >.
Find the Webroot directory just Java proejct, the next time you start Tomcat (6.0), you can access the project directly, the project name is the demo "XML file name."
If use is tomcat5.0, you need to define the name of the project.
Java project deployment to the Tomcat server