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

HTML under tomcat7

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have form file under tomcat webapp directory in a subdirectory call test

localhost:8080/test/form

Got 404 error. Can someone help? Thank
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By "form file", do you mean an HTML page? If so, it's probably named "form.html" - so the URL would be http://localhost:8080/test/form.html
 
Franklyn Simon
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was having problem submitting my question when it included html, so I left it off. But that is exactly ( http://localhost:8080/test/form.html) what I used in the browser. Therefore, I am still having the problem of getting html file to work it tomcat7. I unchecked HTML for the option now. Thanks

 
Saloon Keeper
Posts: 22256
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat is a J2EE server. And like all J2EE servers "putting a file under a directory in Tomcat webapps" does not qualify.

Tomcat is not some kind of file server or receptacle for miscellaneous trash. It is a webapp server. If you want Tomcat to serve up content, it must be in the form of a webapp - specifically a WAR.

A WAR in strict J2EE terms is a ZIP-format (JAR) file containing certain "files" and "directories". If those components are not present, Tomcat won't recognize file as a WAR and therefore it won't recognize it as a webapp.

What causes confusion is that one of the many ways that Tomcat allows you to deploy WARs is in "exploded" form. An exploded WAR is a WAR that has been unzipped into actual directories and files, contained under a single directory, which is the name of the WAR. Which, by default, Tomcat will use as the webapp's context path root.

In other words, you can do a sloppy simple deployment of a webapp by unzipping a WAR into a directory under TOMCAT_HOME/webapps. But if it doesn't contain the basic elements of a WAR (webapp), Tomcat is likely to ignore it.
 
There’s no place like 127.0.0.1. But I'll always remember this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic