Question:
怎么修改配置文件?
Answer:
Unless you are using a "J2EE web application" there is no simple way to do this. I would suggest creating a new web application and registering it with tomcat.
A web application is essentially a standardised directory structure containing all of the resources for your application. Using this standardised approach means that you can migrate your application to another JSP 1.1/Servlet 2.2 compatible server in the future very easily.
The examples directory under your tomcat webapps directory (c:\tc\jakarta-tomcat\webapps) is a good example of how to setup a webapp, and the important points to note are the WEB-INF directory and its web.xml file.
Once you've setup your web application, you can register it with tomcat by opening up the server.xml file from the "conf" directory under your tomcat installation. Again, take a look at how the example application is registered and use the same mechanism for registering your new webapp. All you need to do is specify the "docBase" attribute as a fully qualified path.
上面的文字大体的讲清楚了如何自己建一个目录来跑JSP和CLASS。我在 UNIX 下按自己的理解做了实验,OK,成功了,请你在 WIN 下也试试,把你的结果贴出来,好吗?
1。open /conf/server.xml and add the following code:
docBase="/www/jsp001"
crossContext="true"
debug="0"
reloadable="true"
trusted="false" >
修改上面的 path 和 docBase
2.Copy the directory /webapps/examples and the WAR file /webapps/examples.war to /www ,change it name to jsp001 and jsp001.war
3.Restart tomcat
4.See what's happened => http:///jsp001_test/
正常的话,你应该看到和 http:///examples/ 一样的内容。