• Post Reply Bookmark Topic Watch Topic
  • New Topic

why FacesServlet should be loaded on startup?

 
kevin redd
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to know why javax.faces.webapp.FacesServlet is always loaded on startup as follows?

<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>


What is the need for FacesServlet to be loaded on startup?

What may be the consequences if we do not load it at startup?

Thanks in advance.
 
Tim Holloway
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because if it doesn't load on startup, it will load on demand. And if that happens, the first JSF request that comes in will experience poor response time, since the extra overhead of starting the JSF FacesServlet will be part of the processing time for that request.

There might be some additional context that I'm unaware of, but there's no virtue in delaying the FacesServlet startup, so I've never had to worry about it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!