Class VmServlet

  • All Implemented Interfaces:
    Serializable, javax.servlet.Servlet, javax.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.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      VmServlet()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected ActionURL getActionURL​(javax.servlet.http.HttpServletRequest request)
      Get a new ActionURL.
      Object getVmReference​(String name, javax.servlet.http.HttpServletRequest request)
      Access the object set in the velocity context for this name, if any.
      protected void includeVm​(String template, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Include the Velocity template, expanded with the current set of references
      void setVmReference​(String name, Object value, javax.servlet.http.HttpServletRequest request)
      Add a reference object to the velocity context by name - if it's not already defined
      protected void setVmStdRef​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Add some standard references to the vm context.
      • 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
    • Constructor Detail

      • VmServlet

        public VmServlet()
    • Method Detail

      • getVmReference

        public Object getVmReference​(String name,
                                     javax.servlet.http.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,
                                   javax.servlet.http.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​(javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response)
        Add some standard references to the vm context.
        Parameters:
        request - The request.
        response - The response.
      • includeVm

        protected void includeVm​(String template,
                                 javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response)
                          throws javax.servlet.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.
        javax.servlet.ServletException
      • getActionURL

        protected ActionURL getActionURL​(javax.servlet.http.HttpServletRequest request)
        Get a new ActionURL.
        Parameters:
        req - The current request.
        Returns:
        A new ActionURL.