• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Apache Tomcat 6 Startup Behavior

 
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been working on a web application running on Apache Tomcat 6.0.16 and 6.0.20. I have one servlet that loads on startup, all URIs are mapped to the Filter class and specific URIs are mapped to the servlet controller class. I have observed on startup (by watching the filter class in the debugger) that Tomcat attempts to serve the welcome page (index.jsp) even though, since there was no formal request, there is nowhere to serve it to. Tomcat just seems to swallow the output. Tomcat does this regardless of whether the startup servlet is specified or not. If a startup servlet is specified, this behavior occurs after the startup servlet is loaded.

This behavior does not seem to cause any problems but I fail to understand why Tomcat attempts to serve a welcome page on startup for this scenario. In my opinion, this is a bug. Why would one want to serve a page on startup?

Is there a reason for Tomcat's observed behavior?
 
Saloon Keeper
Posts: 28126
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd look again. Web servers don't volunteer things, so something would have to request it. Maybe your filter is doing something unexpected.
 
Jay Damon
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is strictly a Tomcat issue. The behavior is caused by mapping all URIs to the Filter. When specific URIs are mapped to the Filter, Tomcat does not exhibit the behavior. The only thing my code does is map all URIs to the Filter. In my opinion, Tomcat should be able to handle that scenario.
 
Whip out those weird instruments of science and probe away! I think it's a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic