Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can't run JSP/HTML files in Tomcat

 
Mark Henryson
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.

 
Niyas Ahmed Sheikh
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.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic