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 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 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 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 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 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 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 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 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 的大作中提到】![](/moin_static193/solenoid/img/up.png) : : 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 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 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.
|
|