org.barracudamvc.core.comp.helper
Class BTemplateGateway

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.barracudamvc.core.comp.helper.ComponentGateway
              extended byorg.barracudamvc.core.comp.helper.BTemplateGateway
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
CompEx10, CompEx8, CompEx9

public abstract class BTemplateGateway
extends ComponentGateway

A custom implementation of the component gateway tailored for template components. All you have to do is instantiate the class with the name of the template and a reference to the model; it takes care of everything else.

See Also:
Serialized Form

Field Summary
protected static org.apache.log4j.Logger logger
           
 
Fields inherited from class org.barracudamvc.core.comp.helper.ComponentGateway
HTTP_SERVLET_REQUEST, HTTP_SERVLET_RESPONSE, recycleChildren
 
Constructor Summary
BTemplateGateway()
           
 
Method Summary
abstract  Class getTemplateClass()
          Return an instance of the template class (must implement Document)
abstract  TemplateModel getTemplateModel()
          Return an instance of the template model
 Document handleDefault(BComponent root, ViewContext vc, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Handle the default HttpRequest.
 
Methods inherited from class org.barracudamvc.core.comp.helper.ComponentGateway
doDelete, doGet, doOptions, doPost, doPut, doTrace, getDOMWriter, getIterator, handleDefault, handleEventException, handleRenderException
 
Methods inherited from class javax.servlet.http.HttpServlet
doHead, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger
Constructor Detail

BTemplateGateway

public BTemplateGateway()
Method Detail

getTemplateModel

public abstract TemplateModel getTemplateModel()
Return an instance of the template model


getTemplateClass

public abstract Class getTemplateClass()
Return an instance of the template class (must implement Document)


handleDefault

public Document handleDefault(BComponent root,
                              ViewContext vc,
                              javax.servlet.http.HttpServletRequest req,
                              javax.servlet.http.HttpServletResponse resp)
                       throws IOException
Handle the default HttpRequest.

Specified by:
handleDefault in class ComponentGateway
Parameters:
root - the root component which will get rendered as a result of this request
vc - the ViewContext object describes what features the client view is capable of supporting
req - the servlet request
resp - the servlet response
Returns:
the Document to be rendered
Throws:
IOException


Copyright © 2004 BarracudaMVC.org All Rights Reserved.