Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP load on startup

 
Jason Brawner
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • 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?
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
I have never used Tomcat. May be somebody else could help?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic