开发者

Running servlet program

开发者 https://www.devze.com 2023-02-01 13:50 出处:网络
I have recently installed Tomcat 6.0.29 on my Ubuntu 10.04 system. Process till the localhost connectivity is fine but when I tried to run a simple hello program, it giving me the following error:

I have recently installed Tomcat 6.0.29 on my Ubuntu 10.04 system. Process till the localhost connectivity is fine but when I tried to run a simple hello program, it giving me the following error:

type Status report

message /opt/apache-tomcat-6.0.29/webapps/examples/WEB-INF/classes/HelloWorldExample

description The requested resource (/opt/apache-tomcat-6.0.29/webapp开发者_StackOverflow社区s/examples/WEB-INF/classes/HelloWorldExample) is not available.

I have tried to reinstall tomcat by the different methods give on other sites but the result is same. I am not yet sure where I am going wrong. Please can anyone describe me the correct method of running a servlet program ie, where to store the actual Java and class files.


  • Have you got a correct web.xml file? It needs servlet and servlet-mapping tags.
  • Check that WAR file from which you deployed your web-app is not corrupted.


always put you class in package, eg, not HelloWorldExample, but foo.HelloWorldExample. Tomcat (and other containers as well) doesn't like default packages.

0

精彩评论

暂无评论...
验证码 换一张
取 消