• 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

JSP load on startup

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I used the following xml in my deployment descriptor expecting Tomcat4 to
generate a servlet from my jsp within the work directory on startup.
<servlet>
<servlet-name>Home</servlet-name>
<jsp-file>/home.jsp</jsp-file>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Home</servlet-name>
<url-pattern>/home.jsp</url-pattern>
</servlet-mapping>
It appears to have done nothing. The servlet isn't generated until I
request home.jsp for the first time. Shouldn't
it have compiled, loaded and initialized my jsp when Tomcat started?
 
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that the load-on-startup tag is to pre-compile a servlet. In WebLogic, we use context-param tag in the web.xml file to precompile a JSP.
 
Jason Brawner
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, the load-on-startup tag does load a servlet. I just assumed it would work for a JSP as well. I know Jasper, an Apache product, will compile the JSP but I would also like it loaded when tomcat starts.
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have never used Tomcat. May be somebody else could help?
reply
    Bookmark Topic Watch Topic
  • New Topic