permaculture playing cards*
The moose likes Servlets and the fly likes WEB.Xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "WEB.Xml" Watch "WEB.Xml" New topic
Author

WEB.Xml

Lucky Chawla
Greenhorn

Joined: Aug 08, 2006
Posts: 22
Hi all
I have a small doubt, If I make a new "myapp" folder in tomcat,s eebapps directory ,And the all the necessary directories are in the myapp directory according to my container,s directory structure.
Now if built a simple html and placed it in myapp directory , My question is that to run this simple html page do i have to modify my web.xml or is ti necessary that web .sml should be there with following form

web.xml:-
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

</web-app>

Thanks
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
you don't need a WEB-INF directory nor a web.xml at all to run purely static content.

Having an eebapps directory isn't going to help though, unless you modify Tomcat's own configuration to look for content there.


42
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Jeroen T Wenting:
you don't need a WEB-INF directory nor a web.xml at all to run purely static content.


Not true.
Tomcat won't consider your directory to be a webapp unless it sees a WEB-INF directory.

It is true that you can deploy a webapp without a web.xml file though.
It is also true that you will want one if you're writing anything more than a few trivial JSPs.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WEB.Xml
 
Similar Threads
JSTL and EL
Tomcat 404 error
Executing my first servlet program
servlet not running but examples does
Alter root of web.xml