Package webwork.view.velocity
Class WebWorkVelocityServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.apache.velocity.servlet.VelocityServlet
webwork.view.velocity.WebWorkVelocityServlet
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public class WebWorkVelocityServlet
extends org.apache.velocity.servlet.VelocityServlet
Velocity integration servlet. Transfer action properties to Velocity context and use WebWork configuration to supply
Velocity with settings.
This allows you to use Velocity templates as views of WebWork actions.
- Version:
- $Revision: 1.7 $
- Author:
- Rickard Őberg (rickard@dreambean.com)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected org.apache.commons.logging.Logprotected static final StringFields inherited from class org.apache.velocity.servlet.VelocityServlet
CONTENT_TYPE, DEFAULT_CONTENT_TYPE, DEFAULT_OUTPUT_ENCODING, INIT_PROPS_KEY, REQUEST, RESPONSE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.velocity.context.ContextcreateContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Create a context that delegates to the standard context and also allows Velocity to access properties from the ValueStack.protected org.apache.velocity.TemplatehandleRequest(javax.servlet.http.HttpServletRequest aRequest, javax.servlet.http.HttpServletResponse aResponse, org.apache.velocity.context.Context ctx) Get the template to show.voidinit()voidservice(javax.servlet.ServletRequest aRequest, javax.servlet.ServletResponse aResponse) Methods inherited from class org.apache.velocity.servlet.VelocityServlet
chooseCharacterEncoding, doGet, doPost, doRequest, error, getTemplate, getTemplate, handleRequest, init, initVelocity, loadConfiguration, mergeTemplate, requestCleanup, setContentTypeMethods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, serviceMethods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log
-
Field Details
-
CONTEXT
- See Also:
-
WEBWORK_UTIL
- See Also:
-
log
protected org.apache.commons.logging.Log log
-
-
Constructor Details
-
WebWorkVelocityServlet
public WebWorkVelocityServlet()
-
-
Method Details
-
init
public void init() throws javax.servlet.ServletException- Overrides:
initin classjavax.servlet.GenericServlet- Throws:
javax.servlet.ServletException
-
service
public void service(javax.servlet.ServletRequest aRequest, javax.servlet.ServletResponse aResponse) throws javax.servlet.ServletException, IOException - Specified by:
servicein interfacejavax.servlet.Servlet- Overrides:
servicein classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
createContext
protected org.apache.velocity.context.Context createContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Create a context that delegates to the standard context and also allows Velocity to access properties from the ValueStack.- Overrides:
createContextin classorg.apache.velocity.servlet.VelocityServlet
-
handleRequest
protected org.apache.velocity.Template handleRequest(javax.servlet.http.HttpServletRequest aRequest, javax.servlet.http.HttpServletResponse aResponse, org.apache.velocity.context.Context ctx) throws Exception Get the template to show.- Overrides:
handleRequestin classorg.apache.velocity.servlet.VelocityServlet- Throws:
Exception
-