org.appfuse.webapp.velocity
Class PageServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.apache.velocity.servlet.VelocityServlet
              extended byorg.appfuse.webapp.velocity.PageServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class PageServlet
extends org.apache.velocity.servlet.VelocityServlet

Extend VelocityServlet to load proper resource loader for page execution.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.velocity.servlet.VelocityServlet
CONTENT_TYPE, DEFAULT_CONTENT_TYPE, DEFAULT_OUTPUT_ENCODING, INIT_PROPS_KEY, REQUEST, RESPONSE
 
Constructor Summary
PageServlet()
           
 
Method Summary
protected  void error(HttpServletRequest req, HttpServletResponse res, Exception e)
          Handle error in Velocity processing.
 org.apache.velocity.Template getTemplate(String name)
          Override the parent getTemplate( String name ) method.
 org.apache.velocity.Template getTemplate(String name, String encoding)
          Override the parent getTemplate(String name, String encoding) method.
 org.apache.velocity.Template handleRequest(HttpServletRequest request, HttpServletResponse response, org.apache.velocity.context.Context ctx)
           
 void init(ServletConfig config)
          Sets servletContext for WebappResourceLoader.
protected  void initVelocity(ServletConfig config)
          Override initVelocity() so we can man-handle the list of resource loaders
 
Methods inherited from class org.apache.velocity.servlet.VelocityServlet
chooseCharacterEncoding, createContext, doGet, doPost, doRequest, handleRequest, loadConfiguration, mergeTemplate, requestCleanup, setContentType
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageServlet

public PageServlet()
Method Detail

init

public void init(ServletConfig config)
          throws ServletException

Sets servletContext for WebappResourceLoader.

Parameters:
config - servlet configuation
Throws:
ServletException

handleRequest

public org.apache.velocity.Template handleRequest(HttpServletRequest request,
                                                  HttpServletResponse response,
                                                  org.apache.velocity.context.Context ctx)

error

protected void error(HttpServletRequest req,
                     HttpServletResponse res,
                     Exception e)
              throws ServletException,
                     IOException
Handle error in Velocity processing.

Throws:
ServletException
IOException

initVelocity

protected void initVelocity(ServletConfig config)
                     throws ServletException
Override initVelocity() so we can man-handle the list of resource loaders

Throws:
ServletException
See Also:
VelocityServlet.initVelocity(ServletConfig)

getTemplate

public org.apache.velocity.Template getTemplate(String name)
                                         throws org.apache.velocity.exception.ResourceNotFoundException,
                                                org.apache.velocity.exception.ParseErrorException,
                                                Exception
Override the parent getTemplate( String name ) method.

Throws:
org.apache.velocity.exception.ResourceNotFoundException
org.apache.velocity.exception.ParseErrorException
Exception
See Also:
VelocityServlet.getTemplate(String, String)

getTemplate

public org.apache.velocity.Template getTemplate(String name,
                                                String encoding)
                                         throws org.apache.velocity.exception.ResourceNotFoundException,
                                                org.apache.velocity.exception.ParseErrorException,
                                                Exception
Override the parent getTemplate(String name, String encoding) method.

Throws:
org.apache.velocity.exception.ResourceNotFoundException
org.apache.velocity.exception.ParseErrorException
Exception
See Also:
VelocityServlet.getTemplate(String, String)


Copyright © 2002-2004