File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

web xml file

 
venkatesh badrinathan
Ranch Hand
Posts: 77
  • 0
  • Mark post as helpful
  • send pies
  • 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..
 
Harinath Kuntamukkala
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You must configure the Servlet in web.xml file.
Thanks,
Hari
 
venkatesh badrinathan
Ranch Hand
Posts: 77
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Pavlos Chatzidimitriou
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
althogh i removed the comment tag, my servlet is not invoked.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic