• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on BeerAdvice example

 
Veena Pointi
Ranch Hand
Posts: 442
  • 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?
 
Rizwan Mohammad
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.
 
Edmund Yong
Ranch Hand
Posts: 164
  • 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.
 
Umesh Adtani
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic