Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reduce the time for converting JSP into servlet

 
sitaram irrinki
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If we request a JSP file for the first time the JSP
file first converted into the servlet for that some
amount of time will be wasted. Shall we reduce this
wastage of time
 
Leandro Melo
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the <load-on-startup> element in web.xml.
 
Paul Bourdeaux
Ranch Hand
Posts: 783
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can precompile your jsp pages before deploying them. This will eliminate the need to compile on the fly for the first request. The <load-on-startup> element in the web.xml shouldn't be used to precompile jsp pages. It is intended for servlets that you need to have loaded and instantiated when the app server starts.
 
Leandro Melo
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, Paul is right. Sorry for the mistake.
Anyway, usually the application servers provide some mechanism to initialize jsps at startup. This is not required by the spec, but most of them allow you to do so.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic