Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Servlet not found - 404 error  RSS feed

 
Ranch Hand
Posts: 43
Chrome Java Notepad
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have started servlets few hours ago. Now i  have created a very simple servlet which is called from a html form. But instead of loading servlet i am getting 404 error.
I have created a directory myapp under webapps folder. Created WEB-INF folder in myapp folder and further classes folder in WEB-INF and placed servlet class file there.  Also I have created web.xml file and placed it in WEB-INF folder. HTML file is located directly under myapp folder. Following are the codes for java, xml and html file.

PostParameterServlet.java




web.xml



a.html



I have tried using links:

localhost:8080/myapp/servlet/pps
localhost:8080/myapp/servlet/PostParameterServlet
localhost:8080/pps

Still no success, Please tell me where i am going wrong and what is the correct solution



 
Sheriff
Posts: 23640
48
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Your servlet classes need to be in a package or the server will not be able to run them.
 
tushar attar
Ranch Hand
Posts: 43
Chrome Java Notepad
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, it worked
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!