Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat installation

 
Anila Mathew
Ranch Hand
Posts: 69
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

This is the first time i am using Tomcat and i wanted to see an html file by running http:localhost:8080/DirName/form.html.I have put form.html in both tomcat/webapps folder and also in D:/dirname/web/. But its giving a file not found exception.What else i need to do?

Thanks,
Anila.
 
chsanthosh kumar
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

This is the first time i am using Tomcat and i wanted to see an html file by running http:localhost:8080/DirName/form.html.I have put form.html in both tomcat/webapps folder and also in D:/dirname/web/. But its giving a file not found exception.What else i need to do?

Thanks,
Anila.

Hi Anila ,

U can place those html files in under webapps/jsp-examples folder.

And u can access from them.

http:localhost:8080/jsp-examples/form.html

Like this.

thanks.
Regards.
Santhosh.Ch
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The right place would be tomcat/webapps/DirName/form.html.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:
The right place would be tomcat/webapps/DirName/form.html.


Yes, and DirName needs to contain a folder named "WEB-INF" in order for Tomcat to see this directory as a web application.
 
Anila Mathew
Ranch Hand
Posts: 69
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf, Ben,

I have placed the form.html in the directory structure you have specified.I have a WEB_INF directory also, but it has an empty web.xml file.Do i need to specify anything in the web.xml to access only the form.html.

Thanks,
Anila
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No but your spelling of WEB-INF incorrectly (you're using an underscore).
 
Ramaswamy Srinivasan
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Place the html file under Tomcat's WebApps folder directly and try calling it from web browser using the following URL,
http:localhost:8080/form.html

-------

If you want to call the file with the following URL
http:localhost:8080/DirName/form.html
you have to create a Web project with J2EE specified web application structure ,
read "Web application structure and deployment for J2EE applications" for more info.

Regards
Sanjiv
 
Ray Stojonic
Ranch Hand
Posts: 326
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ramaswamy Srinivasan:
Place the html file under Tomcat's WebApps folder directly and try calling it from web browser using the following URL,
http:localhost:8080/form.html


Not quite. Even the server root path is a context. It is contained in, no surprise, webapps/ROOT.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic