• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

A simple html form with TomCat

 
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 67268
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use mysite.com as the folder under web apps, that will be the context path, not BeerV1.
 
shivang sarawagi
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it was by mistake given as mysite, actually its BeerV1
 
Bear Bibeault
Sheriff
Posts: 67268
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read AvoidRedHerrings
 
shivang sarawagi
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i apologize but please tell me why is the error occurring, am i missing something ??
 
Bartender
Posts: 20838
125
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!