wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Tomcat Welcome ROOT web app problems - only some content displaying Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat Welcome ROOT web app problems - only some content displaying" Watch "Tomcat Welcome ROOT web app problems - only some content displaying" New topic
Author

Tomcat Welcome ROOT web app problems - only some content displaying

Rebeccah Quevedo-Prastein
Greenhorn

Joined: Mar 17, 2011
Posts: 16
This started out being a question about configuring a custom 404 error page when the URL doesn't match a webapp context, but has morphed.

I have Tomcat 6. I haven't actually deployed my web app yet. I've got the docs app, the manager app, and the "Welcome to Tomcat!" ROOT app.

Regarding my original problem, adding a simple custom error html page and adding the <error-page> element to web.xml didn't work (still get tomcat default 404 page with http://localhost:8080/anything).

So I tried just looking at the error page itself: Http://localhost:8080/error404.html.
Nope, that gets a tomcat 404 error, too.
So does http://localhost:8080/RELEASE-NOTES.txt, which comes with the application and *should* work. It displays fine in an older version of Tomcat running on another server.
WTF?

Now, the following URLs do display correctly
http://localhost:8080
http://localhost:8080/
http://localhost:8080/index.html
http://localhost:8080/index.jsp
http://localhost:8080/asf-logo-wide.gif
http://localhost:8080/tomcat.gif
http://localhost:8080/tomcat-power.gif

All of these are related to the display of the welcome page.
Nothing else displays.

Now, it's quite possible that I hosed something while playing around trying to figure out where to put the custom error pages, but WHAT could I have hosed? I've tried removing the temp file, removing the work file, restarting tomcat.

This is very frustrating, not to mention a big waste of time for something so simple.

Any suggestions?

Thanks,

Rebeccah
Rebeccah Quevedo-Prastein
Greenhorn

Joined: Mar 17, 2011
Posts: 16
Arrgh.

OK, some files but not others because my browser was caching.

But now, after I put everything back the way it was, why:
If I copy everything from the default web.xml into the ROOT webapp's web.xml, does the ROOT webapp stop finding the pages?

The only thing that was in the ROOT webapp was the display-name and the description, and I kept those. It's supposed to take the information from the default one.

Hmm. Maybe relative paths play a role, since the default one was in conf, and the ROOT one is in WEB-INF? No, there are no references that I see to locations on the server. Frustrating.

Rebeccah
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61433
    
  67

Why did you copy the contents of the default web.xml? It's the default -- repeating it in the individual apps is not only unnecessary but discouraged.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rebeccah Quevedo-Prastein
Greenhorn

Joined: Mar 17, 2011
Posts: 16
I was experimenting, thinking maybe the code I was adding was somehow not getting itself inserted in the right order into the default code, but it didn't help to identify what the problem was.

I still don't know what the problem was, and can only assume I must have made a typo when I was working on this last week, because I tried again yesterday and everything went fine. Go figure.

Rebeccah
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat Welcome ROOT web app problems - only some content displaying