Bookmark Topic Watch Topic
  • New Topic

Prblem while running Servlet program

 
Jay Shukla
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi I have following folder structure in my apache-tomcat-6.0.16\webapps folder.



web.xml
=======




I tried to run FirstServlet by giving following URL but it gives me resource NOT available (HTTP Status 404)

http://localhost/Ch01/firstservlet

Please help me in resolving above.

Thanks in Advance.
 
Mohamed Inayath
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Report post to moderator
Classes under web-inf/classes should be in package.

Change and deploy it will work.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Mohamed Inayath wrote:Classes under web-inf/classes should be in package.

It's WEB-INF, not web-inf.

Where is the WEB-INF folder?
 
Hesham Abo El-Magd
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Report post to moderator
it should be Ch01\WEB-INF\Classes\FirstServlet.class .......WEB-INF folder includes the web.xml file and other folders
Change the Structure and it should work with you then !
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
And as pointed out in the other topic, classes should not be placed in the default package.

As this is starting to overlap that other thread, I'm closing this one.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!