File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes web xml file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "web xml file" Watch "web xml file" New topic
Author

web xml file

venkatesh badrinathan
Ranch Hand

Joined: Aug 03, 2008
Posts: 77
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..


SCJP1.5
Harinath Kuntamukkala
Ranch Hand

Joined: May 17, 2005
Posts: 37
Hi,
You must configure the Servlet in web.xml file.
Thanks,
Hari
venkatesh badrinathan
Ranch Hand

Joined: Aug 03, 2008
Posts: 77
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

Joined: Aug 18, 2008
Posts: 10
I think you should remove and and it will be ok.You can look here for more details.
venkatesh badrinathan
Ranch Hand

Joined: Aug 03, 2008
Posts: 77
althogh i removed the comment tag, my servlet is not invoked.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5


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


Java Resources at www.wbrogden.com
Harinath Kuntamukkala
Ranch Hand

Joined: May 17, 2005
Posts: 37
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
 
subject: web xml file
 
Similar Threads
strange instructions for servlet setup
Where to place HTML file in Tomcat 5
Tomcat without web applications
"Applet not initiated" in Tomcat 3.3
Configuring tomcat 6 with eclipse to serve servlets and jsp/html.