File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes A simple html form with TomCat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "A simple html form with TomCat" Watch "A simple html form with TomCat" New topic
Author

A simple html form with TomCat

shivang sarawagi
Ranch Hand

Joined: Jun 19, 2008
Posts: 148
I know the basic directory structure under Tomcat is as follows :
webapps/BeerV1/ with WEB-INF/classes directly beneath that.

i built a html form saved it in BeerV1/web directory and copied it under webapps/BeerV1/form.html

also i built a XML DD file web.xml in BeerV1/etc and copied it in BeerV1/WEB-INF
but when i am running http://localhost:8080/BeerV1/form.html

error is occurring 404 resource not found. the default html pages are getting executed. please anyone help me out
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61592
    
  67

If you use mysite.com as the folder under web apps, that will be the context path, not BeerV1.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
shivang sarawagi
Ranch Hand

Joined: Jun 19, 2008
Posts: 148
it was by mistake given as mysite, actually its BeerV1
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61592
    
  67

Please read AvoidRedHerrings
shivang sarawagi
Ranch Hand

Joined: Jun 19, 2008
Posts: 148
i apologize but please tell me why is the error occurring, am i missing something ??
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16222
    
  21


I know the basic directory structure under Tomcat is as follows :
webapps/BeerV1/ with WEB-INF/classes directly beneath that.


Actually, then, you DON'T know the basic directory structure under Tomcat. Tomcat employs (by default), the directory TOMCAT_HOME/webapps. Within that directory you can deploy J2EE web applications. At that point, however, you're no longer "Tomcat directory structure", you're J2EE WAR structure. Each WAR appears as a file and/or directory in Tomcat_HOME/webapps, and the structure from that point downwards is set by the J2EE standard, not by Tomcat. Within the webapps directory, if a file ending in ".war" and a directory (no extension) have the same name, Tomcat will deploy the directory version of the app and ignore the WAR file (even if it's newer than the directory version). That's assuming that you're running Tomcat with the factory options and that you didn't define an explicit Tomcat Context.

Within a WAR, the J2EE standard states that the WEB-INF folder and its children cannot be access by URL request. So anything you put there can only be used by application logic and not served directly to clients.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A simple html form with TomCat