• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HTTP 404 Error

 
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello to everyone....
I am trying a very simple example on servlet. When i do my coding in Netbeans it works fine but we all know that doing programs in Notepad is always good for beginners so when i did i get the 404 error. I am using Tomcat 5.5
.
1) My HTML file saved as Basic_Servlet.html

.
2)My servlet saved as My_Demo.java

.
.
3) My web.xml

.
.
Thanks in advance.
 
Ranch Hand
Posts: 277
Oracle Spring Flex
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The value of action attribute of Form tag should match the URL pattern of the servlet specified in the web.xml
 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
simply put My_Demo in the action attribute in html file
 
Greenhorn
Posts: 24
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http:\\localhost:8080\servlets-examples\servlet\My_Demo

i guess everything is right. but error in the url pattern. use - http://localhost:8080/servlets-examples/servlet/My_Demo
 
Rameshwar Soni
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks everyone for their suggestion...Its finally running
 
Vigneswaran Marimuthu
Greenhorn
Posts: 24
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
that's great... Even i am learning JAVA. basically i am from ECE.
 
Rameshwar Soni
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vigneswaran Marimuthu wrote:that's great... Even i am learning JAVA. basically i am from ECE.


Same here learning Java but i am from IT.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Unfortunately, you are still having a problem. By placing code under the servlet examples, you are actually making use of the dreaded Invoker Servlet.

This unfortunate invention, which was intended to make it easy for beginners, lets you get away with servlet classes not defined in a package. Thus failing when you attempt to deploy anywhere but the examples.

See numerous examples in this forum history.

Bill
 
Rameshwar Soni
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

William Brogden wrote:Unfortunately, you are still having a problem. By placing code under the servlet examples, you are actually making use of the dreaded Invoker Servlet.


Thank you for explaining a topic "Invoker Servlet" which i never knew.
 
Vigneswaran Marimuthu
Greenhorn
Posts: 24
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks William for your information about invoker servlet. I am using web.xml of WEB-INF folder to map servlets because in our company eclipse is the IDE Now i came to know about INVOKER SERVLET
 
Watchya got in that poodle gun? Anything for me? Or this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic