org.sakaiproject.vm
Class VmServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.sakaiproject.vm.ComponentServlet
              extended byorg.sakaiproject.vm.VmServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig
Direct Known Subclasses:
VmServlet

public abstract class VmServlet
extends ComponentServlet

VmServlet is a Servlet that makes use of the Velocity Template Engine.

This extends our ComponentServlet, giving us also the ability to find registered service components.

Version:
$Revision: 1350 $
Author:
University of Michigan, CHEF Software Development Team
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.sakaiproject.vm.ComponentServlet
ATTR_PARAMS
 
Constructor Summary
VmServlet()
           
 
Method Summary
protected  ActionURL getActionURL(HttpServletRequest request)
          Get a new ActionURL.
 Object getVmReference(String name, HttpServletRequest request)
          Access the object set in the velocity context for this name, if any.
protected  void includeVm(String template, HttpServletRequest request, HttpServletResponse response)
          Include the Velocity template, expanded with the current set of references
 void setVmReference(String name, Object value, HttpServletRequest request)
          Add a reference object to the velocity context by name - if it's not already defined
protected  void setVmStdRef(HttpServletRequest request, HttpServletResponse response)
          Add some standard references to the vm context.
 
Methods inherited from class org.sakaiproject.vm.ComponentServlet
sendParentRedirect, service, setNoCacheHeaders
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, 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
 

Constructor Detail

VmServlet

public VmServlet()
Method Detail

getVmReference

public Object getVmReference(String name,
                             HttpServletRequest request)
Access the object set in the velocity context for this name, if any.

Parameters:
name - The reference name.
request - The request.
Returns:
The reference value object, or null if none

setVmReference

public void setVmReference(String name,
                           Object value,
                           HttpServletRequest request)
Add a reference object to the velocity context by name - if it's not already defined

Parameters:
name - The reference name.
value - The reference value object.
request - The request.

setVmStdRef

protected void setVmStdRef(HttpServletRequest request,
                           HttpServletResponse response)
Add some standard references to the vm context.

Parameters:
request - The request.
response - The response.

includeVm

protected void includeVm(String template,
                         HttpServletRequest request,
                         HttpServletResponse response)
                  throws ServletException
Include the Velocity template, expanded with the current set of references

Parameters:
template - The path, relative to the webapp context, of the template file
request - The render request.
response - The render response.
Throws:
PortletException - if something goes wrong.
ServletException

getActionURL

protected ActionURL getActionURL(HttpServletRequest request)
Get a new ActionURL.

Returns:
A new ActionURL.