• 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

web xml file

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am new to servlet technology. i have written my first servlet program and placed it in web-inf/classes folder in tomcat. and my html page in root directory. the issue is whether i should configure web.xml file or not?(although i configured it, i got 404 error, saying that the particular servlet file is not found).
i have heard my friend saying that when we place html file in root directory, we do not need to configure xml file. why is that so?? can someone explain please..
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
You must configure the Servlet in web.xml file.
Thanks,
Hari
 
venkatesh badrinathan
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi harinath, i have configured my xml file but got the err 404 as i have mentioned above. how should i fix this?
my xml file is as follows,

here 'vec' is the servlet prog name and the class name itself, whose class file is been placed in classes folder inside web-inf dir.
is there any err in my xml file..(i always go wrong in configuring xml file). please provide some links or explain me if possible. thanks in advance.
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you should remove and and it will be ok.You can look here for more details.
 
venkatesh badrinathan
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
althogh i removed the comment tag, my servlet is not invoked.
 
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


All classe used in servlets should be in a package to avoid mysterious problems.

You may be following an old pattern that depended on the dreaded Invoker servlet.

Bill
 
Harinath Kuntamukkala
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Venkatesh,

The problem is that the server is not able to find your servlet. Please check wheather the corresponding class file (with package structure) is in WEB-INF/classes folder or not.

Thanks,
Hari
 
reply
    Bookmark Topic Watch Topic
  • New Topic