由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Run Servlet with Tomcat
相关主题
求助!Tomcat下设置servlets的问题大家愿意讨论一下log4j么
still web.xml questiontomcat 访问硬盘文件的问题, 3x
HTTP Status 404 The requested resource (/abc/index.jsp) is not available.J2EE: why is my .jsp not refreshed?
tomcat连接mysql求助菜鸟请教版上大虾--如何用Java建一个连接Dababase的Tomcat网页
servlet-mapping causing http 404 error请问JSP里这个怎么设
运行servlet时出现的http status 404问题大家都是怎么自学J2EE的
URL 的问题怎么解决?in eclipse EE , how to build a tomcat/web application?
[转载] Urgent Help needed about Java Servlet?Help on compiling servlet with Tomcat
相关话题的讨论汇总
话题: servlet话题: tomcat话题: run话题: webapps
进入Java版参与讨论
1 (共1页)
h******m
发帖数: 10
1
Hi guys,
I installed tomcat 4,the server works fine (shows up the test page),and the
servlet code compiles, but I can't load it with local:8080
That's what I did:create a directory of 'classes' under
webapps/Root/WEB-INF/,then put my .class file there,but when I tried
http:localhost:8080/servlet/HelloWorld, it doesn't load,always shows up
....file not available, seems I put the .class into a wrong place.
What's wrong with it?
Thanks.
s*******g
发帖数: 59
2
have you enable root context?
also make reloadable = true.

【在 h******m 的大作中提到】
: Hi guys,
: I installed tomcat 4,the server works fine (shows up the test page),and the
: servlet code compiles, but I can't load it with local:8080
: That's what I did:create a directory of 'classes' under
: webapps/Root/WEB-INF/,then put my .class file there,but when I tried
: http:localhost:8080/servlet/HelloWorld, it doesn't load,always shows up
: ....file not available, seems I put the .class into a wrong place.
: What's wrong with it?
: Thanks.

s****d
发帖数: 13
3
better setup it in the web.xml using something like below

HelloWorldExample
HelloWorldExample



HelloWorldExample
/HelloWorldExample


the

【在 s*******g 的大作中提到】
: have you enable root context?
: also make reloadable = true.

y**a
发帖数: 13
4
Actually, you can save your own servlet files in any directory you like. But
you need configerate the server.xml file under conf dir to tell your tomcat
server where your application. Following is an example:
debug="0" privileged="true">

where path is the path for URL, and docBase is for your working directory on
your machine. So after you add above to server.xml, the URL would be
http://localhost:8080/w

【在 h******m 的大作中提到】
: Hi guys,
: I installed tomcat 4,the server works fine (shows up the test page),and the
: servlet code compiles, but I can't load it with local:8080
: That's what I did:create a directory of 'classes' under
: webapps/Root/WEB-INF/,then put my .class file there,but when I tried
: http:localhost:8080/servlet/HelloWorld, it doesn't load,always shows up
: ....file not available, seems I put the .class into a wrong place.
: What's wrong with it?
: Thanks.

h******m
发帖数: 10
5

well, which web.xml should I do? There is one in /conf, and others somewhere
else.
I did make these changed in server.xml and web.xml under the conf,seems not
help...Shall I try these in the webadv/...?
Thanks.

【在 s****d 的大作中提到】
: better setup it in the web.xml using something like below
:
: HelloWorldExample
: HelloWorldExample
:

:
:
: HelloWorldExample
: /HelloWorldExample
:

y**a
发帖数: 13
6
each project has its own web.xml. So if you save your servlet under
webapps/Root, then you need modify the web.xml under webapps/Root/WEB-INF

【在 h******m 的大作中提到】
:
: well, which web.xml should I do? There is one in /conf, and others somewhere
: else.
: I did make these changed in server.xml and web.xml under the conf,seems not
: help...Shall I try these in the webadv/...?
: Thanks.

b*e
发帖数: 3845
7
Here comes the link of authority.
http://www.moreservlets.com/Using-Tomcat-4.html
Be aware that TOMCAT 4 is different than Tomcat 3. If you set up
you own app directory under webapps, all the classes that you create
must be in a package.

【在 h******m 的大作中提到】
: Hi guys,
: I installed tomcat 4,the server works fine (shows up the test page),and the
: servlet code compiles, but I can't load it with local:8080
: That's what I did:create a directory of 'classes' under
: webapps/Root/WEB-INF/,then put my .class file there,but when I tried
: http:localhost:8080/servlet/HelloWorld, it doesn't load,always shows up
: ....file not available, seems I put the .class into a wrong place.
: What's wrong with it?
: Thanks.

1 (共1页)
进入Java版参与讨论
相关主题
Help on compiling servlet with Tomcatservlet-mapping causing http 404 error
servlet读取directory的基本问题运行servlet时出现的http status 404问题
Maven把eclipse的项目搞得不能用了URL 的问题怎么解决?
Re: Desperately need help on DB2 connection through jdbc in jsp page[转载] Urgent Help needed about Java Servlet?
求助!Tomcat下设置servlets的问题大家愿意讨论一下log4j么
still web.xml questiontomcat 访问硬盘文件的问题, 3x
HTTP Status 404 The requested resource (/abc/index.jsp) is not available.J2EE: why is my .jsp not refreshed?
tomcat连接mysql求助菜鸟请教版上大虾--如何用Java建一个连接Dababase的Tomcat网页
相关话题的讨论汇总
话题: servlet话题: tomcat话题: run话题: webapps