Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding setDefaultFactory(JspFactory deflt) of JspFactory.

 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Can you please explain me, at which stage of jsp life cycle, the setDefaultFactory() is called? Thankyou.
 
Tyler Wright
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chinmaya,

Are you asking about the setDefaultFactory() on JspFactory?

The JspFactory is an abstract class that defines a number of factory methods available to a JSP page at runtime for the purposes of creating instances of various interfaces and classes used to support the JSP implementation.

A conformant JSP Engine implementation will, during it's initialization instantiate an implementation dependent subclass of this class, and make it globally available for use by JSP implementation classes by registering the instance created with this class via the static setDefaultFactory() method.

The PageContext and the JspEngineInfo classes are the only implementation-dependent classes that can be created from the factory.

JspFactory objects should not be used by JSP page authors.


So, since the setDefaultFactory method is static, it is called when java classloader loads, links, and initializes the class: during the initialization of the class the static methods are called.

However, since the factory is really part of the container, it is not explicitly part of the JSP lifecycle. Since the container classes are loaded, linked, and initialized prior to the JSPs.

I hope someone will correct this if I am mistaken...

regards,
Tyler



 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tyler. This makes sense. Thankyou.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic