Programmers Guide > Extending JOT Beans

Extending JOT Beans

The JOT Servlets Java web components framework renders dynamic content with the properties of Java objects, including JotBean, J2EE and POJO classes (plain old java objects). The framework provides the following JOT Bean classes that applications can subclass:

  JotPropertyBean implements JotBean. JOT Tokens reference the properties of JotBeans and other server-side Java objects.

  JotServletPropertyBean implements JotServletBean. JotServletPropertyBeans automatically have properties for Request parameters, Request, Session, and Application attributes, and JSP Page scope attributes. Subclasses override initJotServletBean() and prepareJotBean() to add initialization before or after the property setter methods are invoked.

  JotServletTemplateBean is the generic base class for JOT Web Components. A JotServletTemplateBean is a JotContentBean that renders dynamic content with a JOT Template. The JOT Template ContentSource is specified by a ContentSourceName initialization parameter, or by calling setContentRenderer(). On JOT Template pages the JOT.Content(templateName) and JOT.Views.Component(className) tokens render nested components.

  JotServletResponseBean is a JotResponseBean that responds to a servlet request. The processRequest() method is called to perform validations and database updates prior to rendering.

The framework automatically invokes JotBean methods in this order:

  1. initJotServletBean() - pre-initialization for JotServletBeans
  2. ...[ setter methods are invoked with request values ]...
  3. prepareJotBean() - initialization for JotBeans
  4. getContentRenderer() - returns a renderer for a given JOT Template ContentSource
  5. processRequest() - JotResponseBean method called before rendering
  6. ...[ response is rendered and sent to client ]...
  7. finalizeJotBean() - cleanup for registered JotBeans (see JotServiceContext)
© 2008 JOT Object Technologies