• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Deploy html pages in tomcat

 
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can we deploy html pages in tomcat?

I tried the following:
put the html page

1) in the tomcat installation directory.
2) in one of the webapps configured in tomcat instance.

in both the cases, i get "Page cannot be found" error.

In both the cases, i restarted tomcat after putting the html page( i understand that a restart is not required)

i used the following url:

http://hostname:port/nameofhtml.html
http://hostname:port/webapp/nameofhtml.html

i understand that apache is used to hold static content and tomcat for jsp and dynamic content. Out of curiosity i want to know if we can deploy html pages in tomcat. if Yes, how?
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Same way that you would a JSP. Tomcat doesn't care if it's a JSP or HTML.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Doublecheck the spelling and use of UPPER and lower case in the file name. A typical Tomcat installation contains many examples of html and image files for example in the tomcat-docs directory.

Bill
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tomcat => Servlet contener + Web server
Apache => Web server

So both Tomcat and Apache is Web server. they don't care what the resource is.
they receive the request and send the response.

Please check the ${CATALINA_HOME}/webapps/${YOUR_WEBAPP_DIR}
has the directory WEB-INF inside it.

Or you can play instantly without create new web application by put
the html or other resources to ${CATALINA_HOME}/webapps/ROOT
open your browser and browse to
http://localhost:8080/yourhtml.html

I hope this help ;)
[ November 29, 2007: Message edited by: Hussachai Puripunpinyo ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic