Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.roller.presentation.velocity
Class PageServlet  view PageServlet download PageServlet.java

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.apache.velocity.servlet.VelocityServlet
              extended byorg.roller.presentation.velocity.RollerServlet
                  extended byorg.roller.presentation.velocity.PageServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class PageServlet
extends RollerServlet

Extend RollerServlet to load proper resource loader for page execution.


Field Summary
private static org.apache.commons.logging.Log mLogger
           
(package private)  org.apache.velocity.app.VelocityEngine ve
          We are overriding the default Runtime Velocity singleton to gain control over the initialization and so that the PreviewResourceLoader is not set for the PageServlet.
 
Fields inherited from class org.apache.velocity.servlet.VelocityServlet
CONTENT_TYPE, DEFAULT_CONTENT_TYPE, DEFAULT_OUTPUT_ENCODING, INIT_PROPS_KEY, REQUEST, RESPONSE
 
Fields inherited from class javax.servlet.http.HttpServlet
 
Fields inherited from class javax.servlet.GenericServlet
 
Constructor Summary
PageServlet()
           
 
Method Summary
 org.apache.velocity.Template getTemplate(java.lang.String name)
          Override the parent getTemplate( String name ) method.
 org.apache.velocity.Template getTemplate(java.lang.String name, java.lang.String encoding)
          Override the parent getTemplate(String name, String encoding) method.
 org.apache.velocity.Template handleRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.velocity.context.Context ctx)
          Implement this method to add your application data to the context, calling the getTemplate() method to produce your return value.
protected  void initVelocity(javax.servlet.ServletConfig config)
          Override initVelocity() so we can man-handle the list of resource loaders and remove "preview" if it is present.
 
Methods inherited from class org.roller.presentation.velocity.RollerServlet
error, init
 
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
 

Field Detail

mLogger

private static org.apache.commons.logging.Log mLogger

ve

org.apache.velocity.app.VelocityEngine ve
We are overriding the default Runtime Velocity singleton to gain control over the initialization and so that the PreviewResourceLoader is not set for the PageServlet.

Constructor Detail

PageServlet

public PageServlet()
Method Detail

handleRequest

public org.apache.velocity.Template handleRequest(javax.servlet.http.HttpServletRequest request,
                                                  javax.servlet.http.HttpServletResponse response,
                                                  org.apache.velocity.context.Context ctx)
Description copied from class: org.apache.velocity.servlet.VelocityServlet
Implement this method to add your application data to the context, calling the getTemplate() method to produce your return value.

In the event of a problem, you may handle the request directly and return null or throw a more meaningful exception for the error handler to catch.

Overrides:
handleRequest in class RollerServlet

initVelocity

protected void initVelocity(javax.servlet.ServletConfig config)
                     throws javax.servlet.ServletException
Override initVelocity() so we can man-handle the list of resource loaders and remove "preview" if it is present.


getTemplate

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


getTemplate

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