This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Can't run JSP/HTML files in Tomcat

 
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am start learning JSP and Servlet with the help of Head First JSP & Servlets. For running JSP and Servlets, the book given some sample codings.

Before that I will tell my enviornment in which I try to work.




Problem
--------
I kept my "form.html" file in c:\tomcat\webapps\Beer-v1\form.html.
I started the Tomcat and the index page is displaying. I also tried some JSP examples and it is working.
But when I had tried to run the form.html(http://localhost:8080/Beer-v1/form.html), but it gives the following error message.

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

I tried by placing the the form.html at the JSP-examples folder.
(http://localhost:8080/examples/jsp/dates/form.html)It's Working.
Then I placed the form.html file at http://localhost:8080/examples/jsp/form.html. That's also working.
Then I placed the form.html file at
http://localhost:8080/examples/form.html. That's also working.

Then I placed the form.html file at the root
http://localhost:8080/form.html. IT'S NOT WORKING!!!


From the above thing, whether anyone tell what's the problem for the form.html file is not running while it is placed eithrt at root
http://localhost:8080/form.html and
http://localhost:8080/Beer-v1/form.html

Since I am following Head First JSP and Servlets book, I want to place the file where they intend to place. After two to three pgms, we can try to place the file o our convenience.
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The directory needs to contain a WEB-INF subdirectory, or Tomcat will not recognize it as a web application.
 
Niyas Ahmed Sheikh
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using Head first JSP & Servlets. In the book they clearly given what re the folders to be created for deployment and development. The following folders WEB-INF,classes,lib,etc and src I have created for deployment and development.
 
And then we all jump out and yell "surprise! we got you this tiny ad!"
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic