a*********s 发帖数: 22 | 1 我想把我自己写的文件放在一个工作目录里,我在tomcat的server.xml里加上了
crossContext="true"/>
可是怎么总是出错啊?比如我写了一个myHelloWorld,放在
D:\jakarta-tomcat-4.1.24\webapps\myapp\WEB-INF\classes试的时候总是得到下面
的错误。如果
文件放在examples目录下(D:\jakarta-tomcat-4.1.24\webapps\examples\WEB-INF\classes)
就可以用。
HTTP Status 404 - /myapp/servlet/myHelloWorld |
m**c 发帖数: 90 | 2
You don't have "web.xml" at ./WEB-INF directory. Check the one in examples.
You need to map "/servlet" in "web.xml".
文件放在examples目录下(D:\jakarta-tomcat-4.1.24\webapps\examples\WEB-INF\class
es)
【在 a*********s 的大作中提到】 : 我想把我自己写的文件放在一个工作目录里,我在tomcat的server.xml里加上了 : : : crossContext="true"/> : 可是怎么总是出错啊?比如我写了一个myHelloWorld,放在 : D:\jakarta-tomcat-4.1.24\webapps\myapp\WEB-INF\classes试的时候总是得到下面 : 的错误。如果 : 文件放在examples目录下(D:\jakarta-tomcat-4.1.24\webapps\examples\WEB-INF\classes) : 就可以用。 : HTTP Status 404 - /myapp/servlet/myHelloWorld
|
a*********s 发帖数: 22 | 3 Thx. But...
I checked the web.xml under examples/web-inf, but looks like there is no place
for me to change the settings. Could you tell me exactly how I should do it?
【在 m**c 的大作中提到】 : : You don't have "web.xml" at ./WEB-INF directory. Check the one in examples. : You need to map "/servlet" in "web.xml". : 文件放在examples目录下(D:\jakarta-tomcat-4.1.24\webapps\examples\WEB-INF\class : es)
|
m**c 发帖数: 90 | 4
Sorry I didn't make myself very clear in my post: You need to have a file
called "web.xml" in "${TOMCAT_HOME}/webapps/myapp/WEB-INF". You can copy
"web.xml" from "${TOMCAT_HOME}/webapps/examples/WEB-INF" to
"${TOMCAT_HOME}/webapps/myapp/WEB-INF", then modify it a little bit. Why
don't post the "web.xml" from "${TOMCAT_HOME}/webapps/examples/WEB-INF" to
this board so that I can take a look?
place
it?
examples.
面
文件放在examples目录下(D:\jakarta-tomcat-4.1.24\webapps\examples\WEB-INF\class
【在 a*********s 的大作中提到】 : Thx. But... : I checked the web.xml under examples/web-inf, but looks like there is no place : for me to change the settings. Could you tell me exactly how I should do it?
|
a*********s 发帖数: 22 | 5 Thx. The following is the web.xml from examples\web-inf. I did copy it into
my work-folder, but don't know how to modify it. I really don't understand
this file.
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
Tomcat Examples
Tomcat Example servlets and JSP pages.
|