• 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

Question on BeerAdvice example

 
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was trying BeerAdvice example given in HFSJ.
In first step I created HTML and copied to webapps/Beer-V1 directory./Beer-V1 didn't have WEB-INF directory yet.I tried running html with the url http://localhost:8080/Beer-V1/form.html.Got pageNotFound 404 error.Added WEB-INF directory to webApps.Restarted the server,I could display form.html page successfully.Do we need WEB-INF directory for every web app under webapps in order for server to deploy web app successfully?Even just to run html which is directly under webappDirectory(Beer-V1) of webapps?
 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, for the least you need to have web.xml under WEB-INF folder. But classes, lib, tags folders are optional. You need them only when you have class files/jar fils/tag files. web.xml is mandatory descritor file for web application.
 
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had exactly the same problem with the HTML file previously. I just need to add the WEB-INF directory. The web.xml is not needed if you just have HTML files.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been successful deploying my one-JSP-page-application which I basically zipped up using winZip and then renamed it as ".war" and restarted tomcat. It extracted the .JSP page file and I had no problem accessing it. It did not require web.xml at all!

Am I missing anything!? I think it should work - tomcat smartly recognizes test.jsp as 'JSP' and compiles it and makes servlet out of it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!