| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
| <!--NewPage-->
|
| <HTML>
|
| <HEAD>
|
| <!-- Generated by javadoc (build 1.4.2_08) on Mon Nov 14 10:15:17 PST 2005 -->
|
| <TITLE>
|
| VelocityViewServlet (Velocity Tools 1.2 Documentation)
|
| </TITLE>
|
|
|
| <META NAME="keywords" CONTENT="org.apache.velocity.tools.view.servlet.VelocityViewServlet class">
|
|
|
| <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">
|
|
|
| <SCRIPT type="text/javascript">
|
| function windowTitle()
|
| {
|
| parent.document.title="VelocityViewServlet (Velocity Tools 1.2 Documentation)";
|
| }
|
| </SCRIPT>
|
|
|
| </HEAD>
|
|
|
| <BODY BGCOLOR="white" onload="windowTitle();">
|
|
|
| |
| <!-- ========= START OF TOP NAVBAR ======= -->
|
| <A NAME="navbar_top"><!-- --></A> |
| <A HREF="#skip-navbar_top" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
| <TR>
|
| <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
| <A NAME="navbar_top_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
| <TR ALIGN="center" VALIGN="top">
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
| </TR>
|
| </TABLE>
|
| </TD>
|
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
| </EM>
|
| </TD>
|
| </TR>
|
|
|
| <TR>
|
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
| <A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityLayoutServlet.html" title="class in org.apache.velocity.tools.view.servlet"><B>PREV CLASS</B></A>
|
| <A HREF="../../../../../../org/apache/velocity/tools/view/servlet/WebappLoader.html" title="class in org.apache.velocity.tools.view.servlet"><B>NEXT CLASS</B></A></FONT></TD>
|
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
| <A HREF="../../../../../../index.html" target="_top"><B>FRAMES</B></A>
|
| <A HREF="VelocityViewServlet.html" target="_top"><B>NO FRAMES</B></A>
|
| <SCRIPT type="text/javascript">
|
| <!--
|
| if(window==top) {
|
| document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
| }
|
| //-->
|
| </SCRIPT>
|
| <NOSCRIPT>
|
| <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
|
| </NOSCRIPT> |
|
|
| </FONT></TD>
|
| </TR>
|
| <TR>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
| </TR>
|
| </TABLE>
|
| <A NAME="skip-navbar_top"></A> |
| <!-- ========= END OF TOP NAVBAR ========= -->
|
|
|
| <HR>
|
| <!-- ======== START OF CLASS DATA ======== -->
|
| <H2>
|
| <FONT SIZE="-1">
|
| org.apache.velocity.tools.view.servlet</FONT>
|
| <BR>
|
| Class VelocityViewServlet</H2>
|
| <PRE>
|
| java.lang.Object
|
| <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by">javax.servlet.GenericServlet
|
| <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by">javax.servlet.http.HttpServlet
|
| <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by"><B>org.apache.velocity.tools.view.servlet.VelocityViewServlet</B>
|
| </PRE>
|
| <DL>
|
| <DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig</DD>
|
| </DL>
|
| <DL>
|
| <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityLayoutServlet.html" title="class in org.apache.velocity.tools.view.servlet">VelocityLayoutServlet</A></DD>
|
| </DL>
|
| <HR>
|
| <DL>
|
| <DT>public class <B>VelocityViewServlet</B><DT>extends javax.servlet.http.HttpServlet</DL>
|
|
|
| <P>
|
| <p>A servlet to process Velocity templates. This is comparable to the |
| the JspServlet for JSP-based applications.</p> |
| |
| <p>The servlet provides the following features:</p> |
| <ul> |
| <li>renders Velocity templates</li> |
| <li>provides support for an auto-loaded, configurable toolbox</li> |
| <li>provides transparent access to the servlet request attributes, |
| servlet session attributes and servlet context attributes by |
| auto-searching them</li> |
| <li>logs to the logging facility of the servlet API</li> |
| </ul> |
| |
| <p>VelocityViewServlet supports the following configuration parameters |
| in web.xml:</p> |
| <dl> |
| <dt>org.apache.velocity.toolbox</dt> |
| <dd>Path and name of the toolbox configuration file. The path must be |
| relative to the web application root directory. If this parameter is |
| not found, no toolbox is instantiated.</dd> |
| <dt>org.apache.velocity.properties</dt> |
| <dd>Path and name of the Velocity configuration file. The path must be |
| relative to the web application root directory. If this parameter |
| is not present, Velocity is initialized with default settings.</dd> |
| </dl> |
| |
| <p>There are methods you may wish to override to access, alter or control |
| any part of the request processing chain. Please see the javadocs for |
| more information on : |
| <ul> |
| <li> <A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#loadConfiguration(javax.servlet.ServletConfig)"><CODE>loadConfiguration(javax.servlet.ServletConfig)</CODE></A> : <br>for loading Velocity properties and |
| configuring the Velocity runtime |
| <li> <A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#setContentType(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)"><CODE>setContentType(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)</CODE></A> : <br>for changing the content type on a request |
| by request basis |
| <li> <A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#requestCleanup(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.velocity.context.Context)"><CODE>requestCleanup(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.velocity.context.Context)</CODE></A> : <br>post rendering resource or other cleanup |
| <li> <A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#error(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Exception)"><CODE>error(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Exception)</CODE></A> : <br>error handling |
| </ul> |
| </p>
|
| <P>
|
|
|
| <P>
|
| <DL>
|
| <DT><B>Version:</B></DT> |
| <DD>$Id: VelocityViewServlet.java 321237 2005-10-14 22:52:17Z nbubna $</DD> |
| <DT><B>Author:</B></DT> |
| <DD>Dave Bryson, <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>, <a href="mailto:sidler@teamup.com">Gabe Sidler</a>, <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>, <a href="mailto:kjohnson@transparent.com">Kent Johnson</a>, <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>, <a href="mailto:nathan@esha.com">Nathan Bubna</a></DD> |
| <DT><B>See Also:</B><DD><A HREF="../../../../../../serialized-form.html#org.apache.velocity.tools.view.servlet.VelocityViewServlet">Serialized Form</A></DL>
|
| <HR>
|
|
|
| <P>
|
| <!-- ======== NESTED CLASS SUMMARY ======== -->
|
|
|
|
|
| <!-- =========== FIELD SUMMARY =========== -->
|
|
|
| <A NAME="field_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
| <TD COLSPAN=2><FONT SIZE="+2">
|
| <B>Field Summary</B></FONT></TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>static java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#CONTENT_TYPE">CONTENT_TYPE</A></B></CODE>
|
|
|
| <BR>
|
| The HTTP content type context key.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>static java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#DEFAULT_CONTENT_TYPE">DEFAULT_CONTENT_TYPE</A></B></CODE>
|
|
|
| <BR>
|
| The default content type for the response</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>static java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#DEFAULT_OUTPUT_ENCODING">DEFAULT_OUTPUT_ENCODING</A></B></CODE>
|
|
|
| <BR>
|
| Default encoding for the output stream</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>private java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#defaultContentType">defaultContentType</A></B></CODE>
|
|
|
| <BR>
|
| The default content type.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected static java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#INIT_PROPS_KEY">INIT_PROPS_KEY</A></B></CODE>
|
|
|
| <BR>
|
| This is the string that is looked for when getInitParameter is |
| called ("org.apache.velocity.properties").</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>static java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#SERVLET_CONTEXT_KEY">SERVLET_CONTEXT_KEY</A></B></CODE>
|
|
|
| <BR>
|
| Key used to access the ServletContext in |
| the Velocity application attributes.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected static java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#TOOLBOX_KEY">TOOLBOX_KEY</A></B></CODE>
|
|
|
| <BR>
|
| Key used to access the toolbox configuration file path from the |
| Servlet or webapp init parameters ("org.apache.velocity.toolbox").</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected <A HREF="../../../../../../org/apache/velocity/tools/view/ToolboxManager.html" title="interface in org.apache.velocity.tools.view">ToolboxManager</A></CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#toolboxManager">toolboxManager</A></B></CODE>
|
|
|
| <BR>
|
| A reference to the toolbox manager.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>private org.apache.velocity.app.VelocityEngine</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#velocity">velocity</A></B></CODE>
|
|
|
| <BR>
|
| </TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>private boolean</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#warnOfOutputStreamDeprecation">warnOfOutputStreamDeprecation</A></B></CODE>
|
|
|
| <BR>
|
| Whether we've logged a deprecation warning for |
| ServletResponse's <code>getOutputStream()</code>.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>private static org.apache.velocity.util.SimplePool</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#writerPool">writerPool</A></B></CODE>
|
|
|
| <BR>
|
| Cache of writers</TD>
|
| </TR>
|
| </TABLE>
|
| <A NAME="fields_inherited_from_class_javax.servlet.http.HttpServlet"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
| <TD><B>Fields inherited from class javax.servlet.http.HttpServlet</B></TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD><CODE></CODE></TD>
|
| </TR>
|
| </TABLE>
|
| <A NAME="fields_inherited_from_class_javax.servlet.GenericServlet"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
| <TD><B>Fields inherited from class javax.servlet.GenericServlet</B></TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD><CODE></CODE></TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
|
|
| <A NAME="constructor_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
| <TD COLSPAN=2><FONT SIZE="+2">
|
| <B>Constructor Summary</B></FONT></TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#VelocityViewServlet()">VelocityViewServlet</A></B>()</CODE>
|
|
|
| <BR>
|
| </TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <!-- ========== METHOD SUMMARY =========== -->
|
|
|
| <A NAME="method_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
| <TD COLSPAN=2><FONT SIZE="+2">
|
| <B>Method Summary</B></FONT></TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected org.apache.velocity.context.Context</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#createContext(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)">createContext</A></B>(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response)</CODE>
|
|
|
| <BR>
|
| Creates and returns an initialized Velocity context.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> void</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)">doGet</A></B>(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response)</CODE>
|
|
|
| <BR>
|
| Handles GET - calls doRequest()</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> void</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)">doPost</A></B>(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response)</CODE>
|
|
|
| <BR>
|
| Handle a POST request - calls doRequest()</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected void</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#doRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)">doRequest</A></B>(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response)</CODE>
|
|
|
| <BR>
|
| Handles with both GET and POST requests</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected void</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#error(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Exception)">error</A></B>(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response, |
| java.lang.Exception e)</CODE>
|
|
|
| <BR>
|
| Invoked when there is an error thrown in any part of doRequest() processing.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#findInitParameter(javax.servlet.ServletConfig, java.lang.String)">findInitParameter</A></B>(javax.servlet.ServletConfig config, |
| java.lang.String key)</CODE>
|
|
|
| <BR>
|
| Looks up an init parameter with the specified key in either the |
| ServletConfig or, failing that, in the ServletContext.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected java.io.Writer</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#getResponseWriter(javax.servlet.http.HttpServletResponse)">getResponseWriter</A></B>(javax.servlet.http.HttpServletResponse response)</CODE>
|
|
|
| <BR>
|
| Procure a Writer with correct encoding which can be used |
| even if HttpServletResponse's <code>getOutputStream()</code> method |
| has already been called.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> org.apache.velocity.Template</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#getTemplate(java.lang.String)">getTemplate</A></B>(java.lang.String name)</CODE>
|
|
|
| <BR>
|
| Retrieves the requested template.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> org.apache.velocity.Template</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#getTemplate(java.lang.String, java.lang.String)">getTemplate</A></B>(java.lang.String name, |
| java.lang.String encoding)</CODE>
|
|
|
| <BR>
|
| Retrieves the requested template with the specified character encoding.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected org.apache.velocity.app.VelocityEngine</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#getVelocityEngine()">getVelocityEngine</A></B>()</CODE>
|
|
|
| <BR>
|
| Returns the underlying VelocityEngine being used.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected java.lang.String</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#getVelocityProperty(java.lang.String, java.lang.String)">getVelocityProperty</A></B>(java.lang.String key, |
| java.lang.String alternate)</CODE>
|
|
|
| <BR>
|
| Simplifies process of getting a property from VelocityEngine, |
| because the VelocityEngine interface sucks compared to the singleton's.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected org.apache.velocity.Template</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#handleRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.velocity.context.Context)">handleRequest</A></B>(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response, |
| org.apache.velocity.context.Context ctx)</CODE>
|
|
|
| <BR>
|
| Handle the template processing request.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE> void</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#init(javax.servlet.ServletConfig)">init</A></B>(javax.servlet.ServletConfig config)</CODE>
|
|
|
| <BR>
|
| Initializes servlet, toolbox and Velocity template engine.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected void</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#initToolbox(javax.servlet.ServletConfig)">initToolbox</A></B>(javax.servlet.ServletConfig config)</CODE>
|
|
|
| <BR>
|
| Initializes the ServletToolboxManager for this servlet's |
| toolbox (if any).</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected void</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#initVelocity(javax.servlet.ServletConfig)">initVelocity</A></B>(javax.servlet.ServletConfig config)</CODE>
|
|
|
| <BR>
|
| Initializes the Velocity runtime, first calling |
| loadConfiguration(ServletConfig) to get a |
| org.apache.commons.collections.ExtendedProperties |
| of configuration information |
| and then calling velocityEngine.init().</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected org.apache.commons.collections.ExtendedProperties</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#loadConfiguration(javax.servlet.ServletConfig)">loadConfiguration</A></B>(javax.servlet.ServletConfig config)</CODE>
|
|
|
| <BR>
|
| Loads the configuration information and returns that |
| information as an ExtendedProperties, which will be used to |
| initialize the Velocity runtime.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected void</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#mergeTemplate(org.apache.velocity.Template, org.apache.velocity.context.Context, javax.servlet.http.HttpServletResponse)">mergeTemplate</A></B>(org.apache.velocity.Template template, |
| org.apache.velocity.context.Context context, |
| javax.servlet.http.HttpServletResponse response)</CODE>
|
|
|
| <BR>
|
| Merges the template with the context.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected void</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#performMerge(org.apache.velocity.Template, org.apache.velocity.context.Context, java.io.Writer)">performMerge</A></B>(org.apache.velocity.Template template, |
| org.apache.velocity.context.Context context, |
| java.io.Writer writer)</CODE>
|
|
|
| <BR>
|
| This is here so developers may override it and gain access to the |
| Writer which the template will be merged into.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected void</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#requestCleanup(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.velocity.context.Context)">requestCleanup</A></B>(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response, |
| org.apache.velocity.context.Context context)</CODE>
|
|
|
| <BR>
|
| Cleanup routine called at the end of the request processing sequence |
| allows a derived class to do resource cleanup or other end of |
| process cycle tasks.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected void</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#setContentType(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)">setContentType</A></B>(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response)</CODE>
|
|
|
| <BR>
|
| Sets the content type of the response.</TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
| <CODE>protected void</CODE></FONT></TD>
|
| <TD><CODE><B><A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#setVelocityEngine(org.apache.velocity.app.VelocityEngine)">setVelocityEngine</A></B>(org.apache.velocity.app.VelocityEngine ve)</CODE>
|
|
|
| <BR>
|
| Sets the underlying VelocityEngine</TD>
|
| </TR>
|
| </TABLE>
|
| <A NAME="methods_inherited_from_class_javax.servlet.http.HttpServlet"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
| <TD><B>Methods inherited from class javax.servlet.http.HttpServlet</B></TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD><CODE>doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service</CODE></TD>
|
| </TR>
|
| </TABLE>
|
| <A NAME="methods_inherited_from_class_javax.servlet.GenericServlet"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
| <TD><B>Methods inherited from class javax.servlet.GenericServlet</B></TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD><CODE>destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log</CODE></TD>
|
| </TR>
|
| </TABLE>
|
| <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
|
| <TD><B>Methods inherited from class java.lang.Object</B></TD>
|
| </TR>
|
| <TR BGCOLOR="white" CLASS="TableRowColor">
|
| <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <P>
|
|
|
| <!-- ============ FIELD DETAIL =========== -->
|
|
|
| <A NAME="field_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
| <TD COLSPAN=1><FONT SIZE="+2">
|
| <B>Field Detail</B></FONT></TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <A NAME="CONTENT_TYPE"><!-- --></A><H3>
|
| CONTENT_TYPE</H3>
|
| <PRE>
|
| public static final java.lang.String <B>CONTENT_TYPE</B></PRE>
|
| <DL>
|
| <DD>The HTTP content type context key.
|
| <P>
|
| <DL>
|
| <DT><B>See Also:</B><DD><A HREF="../../../../../../constant-values.html#org.apache.velocity.tools.view.servlet.VelocityViewServlet.CONTENT_TYPE">Constant Field Values</A></DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="DEFAULT_CONTENT_TYPE"><!-- --></A><H3>
|
| DEFAULT_CONTENT_TYPE</H3>
|
| <PRE>
|
| public static final java.lang.String <B>DEFAULT_CONTENT_TYPE</B></PRE>
|
| <DL>
|
| <DD>The default content type for the response
|
| <P>
|
| <DL>
|
| <DT><B>See Also:</B><DD><A HREF="../../../../../../constant-values.html#org.apache.velocity.tools.view.servlet.VelocityViewServlet.DEFAULT_CONTENT_TYPE">Constant Field Values</A></DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="DEFAULT_OUTPUT_ENCODING"><!-- --></A><H3>
|
| DEFAULT_OUTPUT_ENCODING</H3>
|
| <PRE>
|
| public static final java.lang.String <B>DEFAULT_OUTPUT_ENCODING</B></PRE>
|
| <DL>
|
| <DD>Default encoding for the output stream
|
| <P>
|
| <DL>
|
| <DT><B>See Also:</B><DD><A HREF="../../../../../../constant-values.html#org.apache.velocity.tools.view.servlet.VelocityViewServlet.DEFAULT_OUTPUT_ENCODING">Constant Field Values</A></DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="SERVLET_CONTEXT_KEY"><!-- --></A><H3>
|
| SERVLET_CONTEXT_KEY</H3>
|
| <PRE>
|
| public static final java.lang.String <B>SERVLET_CONTEXT_KEY</B></PRE>
|
| <DL>
|
| <DD>Key used to access the ServletContext in |
| the Velocity application attributes.
|
| <P>
|
| <DL>
|
| </DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="TOOLBOX_KEY"><!-- --></A><H3>
|
| TOOLBOX_KEY</H3>
|
| <PRE>
|
| protected static final java.lang.String <B>TOOLBOX_KEY</B></PRE>
|
| <DL>
|
| <DD>Key used to access the toolbox configuration file path from the |
| Servlet or webapp init parameters ("org.apache.velocity.toolbox").
|
| <P>
|
| <DL>
|
| <DT><B>See Also:</B><DD><A HREF="../../../../../../constant-values.html#org.apache.velocity.tools.view.servlet.VelocityViewServlet.TOOLBOX_KEY">Constant Field Values</A></DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="INIT_PROPS_KEY"><!-- --></A><H3>
|
| INIT_PROPS_KEY</H3>
|
| <PRE>
|
| protected static final java.lang.String <B>INIT_PROPS_KEY</B></PRE>
|
| <DL>
|
| <DD>This is the string that is looked for when getInitParameter is |
| called ("org.apache.velocity.properties").
|
| <P>
|
| <DL>
|
| <DT><B>See Also:</B><DD><A HREF="../../../../../../constant-values.html#org.apache.velocity.tools.view.servlet.VelocityViewServlet.INIT_PROPS_KEY">Constant Field Values</A></DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="toolboxManager"><!-- --></A><H3>
|
| toolboxManager</H3>
|
| <PRE>
|
| protected <A HREF="../../../../../../org/apache/velocity/tools/view/ToolboxManager.html" title="interface in org.apache.velocity.tools.view">ToolboxManager</A> <B>toolboxManager</B></PRE>
|
| <DL>
|
| <DD>A reference to the toolbox manager.
|
| <P>
|
| <DL>
|
| </DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="writerPool"><!-- --></A><H3>
|
| writerPool</H3>
|
| <PRE>
|
| private static org.apache.velocity.util.SimplePool <B>writerPool</B></PRE>
|
| <DL>
|
| <DD>Cache of writers
|
| <P>
|
| <DL>
|
| </DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="velocity"><!-- --></A><H3>
|
| velocity</H3>
|
| <PRE>
|
| private org.apache.velocity.app.VelocityEngine <B>velocity</B></PRE>
|
| <DL>
|
| <DL>
|
| </DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="defaultContentType"><!-- --></A><H3>
|
| defaultContentType</H3>
|
| <PRE>
|
| private java.lang.String <B>defaultContentType</B></PRE>
|
| <DL>
|
| <DD>The default content type. When necessary, includes the |
| character set to use when encoding textual output.
|
| <P>
|
| <DL>
|
| </DL>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="warnOfOutputStreamDeprecation"><!-- --></A><H3>
|
| warnOfOutputStreamDeprecation</H3>
|
| <PRE>
|
| private boolean <B>warnOfOutputStreamDeprecation</B></PRE>
|
| <DL>
|
| <DD>Whether we've logged a deprecation warning for |
| ServletResponse's <code>getOutputStream()</code>.
|
| <P>
|
| <DL>
|
| <DT><B>Since:</B></DT> |
| <DD>VelocityTools 1.1</DD> |
| </DL>
|
| </DL>
|
|
|
| <!-- ========= CONSTRUCTOR DETAIL ======== -->
|
|
|
| <A NAME="constructor_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
| <TD COLSPAN=1><FONT SIZE="+2">
|
| <B>Constructor Detail</B></FONT></TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <A NAME="VelocityViewServlet()"><!-- --></A><H3>
|
| VelocityViewServlet</H3>
|
| <PRE>
|
| public <B>VelocityViewServlet</B>()</PRE>
|
| <DL>
|
| </DL>
|
|
|
| <!-- ============ METHOD DETAIL ========== -->
|
|
|
| <A NAME="method_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
| <TD COLSPAN=1><FONT SIZE="+2">
|
| <B>Method Detail</B></FONT></TD>
|
| </TR>
|
| </TABLE>
|
|
|
| <A NAME="init(javax.servlet.ServletConfig)"><!-- --></A><H3>
|
| init</H3>
|
| <PRE>
|
| public void <B>init</B>(javax.servlet.ServletConfig config) |
| throws javax.servlet.ServletException</PRE>
|
| <DL>
|
| <DD><p>Initializes servlet, toolbox and Velocity template engine. |
| Called by the servlet container on loading.</p> |
| |
| <p>NOTE: If no charset is specified in the default.contentType |
| property (in your velocity.properties) and you have specified |
| an output.encoding property, then that will be used as the |
| charset for the default content-type of pages served by this |
| servlet.</p>
|
| <P>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>config</CODE> - servlet configuation |
| <DT><B>Throws:</B> |
| <DD><CODE>javax.servlet.ServletException</CODE></DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="findInitParameter(javax.servlet.ServletConfig, java.lang.String)"><!-- --></A><H3>
|
| findInitParameter</H3>
|
| <PRE>
|
| protected java.lang.String <B>findInitParameter</B>(javax.servlet.ServletConfig config, |
| java.lang.String key)</PRE>
|
| <DL>
|
| <DD>Looks up an init parameter with the specified key in either the |
| ServletConfig or, failing that, in the ServletContext.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getVelocityProperty(java.lang.String, java.lang.String)"><!-- --></A><H3>
|
| getVelocityProperty</H3>
|
| <PRE>
|
| protected java.lang.String <B>getVelocityProperty</B>(java.lang.String key, |
| java.lang.String alternate)</PRE>
|
| <DL>
|
| <DD>Simplifies process of getting a property from VelocityEngine, |
| because the VelocityEngine interface sucks compared to the singleton's. |
| Use of this method assumes that <A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#initVelocity(javax.servlet.ServletConfig)"><CODE>initVelocity(ServletConfig)</CODE></A> |
| has already been called.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getVelocityEngine()"><!-- --></A><H3>
|
| getVelocityEngine</H3>
|
| <PRE>
|
| protected org.apache.velocity.app.VelocityEngine <B>getVelocityEngine</B>()</PRE>
|
| <DL>
|
| <DD>Returns the underlying VelocityEngine being used.
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="setVelocityEngine(org.apache.velocity.app.VelocityEngine)"><!-- --></A><H3>
|
| setVelocityEngine</H3>
|
| <PRE>
|
| protected void <B>setVelocityEngine</B>(org.apache.velocity.app.VelocityEngine ve)</PRE>
|
| <DL>
|
| <DD>Sets the underlying VelocityEngine
|
| <P>
|
| <DD><DL>
|
| </DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="initToolbox(javax.servlet.ServletConfig)"><!-- --></A><H3>
|
| initToolbox</H3>
|
| <PRE>
|
| protected void <B>initToolbox</B>(javax.servlet.ServletConfig config) |
| throws javax.servlet.ServletException</PRE>
|
| <DL>
|
| <DD>Initializes the ServletToolboxManager for this servlet's |
| toolbox (if any).
|
| <P>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>config</CODE> - servlet configuation |
| <DT><B>Throws:</B> |
| <DD><CODE>javax.servlet.ServletException</CODE></DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="initVelocity(javax.servlet.ServletConfig)"><!-- --></A><H3>
|
| initVelocity</H3>
|
| <PRE>
|
| protected void <B>initVelocity</B>(javax.servlet.ServletConfig config) |
| throws javax.servlet.ServletException</PRE>
|
| <DL>
|
| <DD>Initializes the Velocity runtime, first calling |
| loadConfiguration(ServletConfig) to get a |
| org.apache.commons.collections.ExtendedProperties |
| of configuration information |
| and then calling velocityEngine.init(). Override this |
| to do anything to the environment before the |
| initialization of the singleton takes place, or to |
| initialize the singleton in other ways.
|
| <P>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>config</CODE> - servlet configuration parameters |
| <DT><B>Throws:</B> |
| <DD><CODE>javax.servlet.ServletException</CODE></DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="loadConfiguration(javax.servlet.ServletConfig)"><!-- --></A><H3>
|
| loadConfiguration</H3>
|
| <PRE>
|
| protected org.apache.commons.collections.ExtendedProperties <B>loadConfiguration</B>(javax.servlet.ServletConfig config) |
| throws java.io.IOException</PRE>
|
| <DL>
|
| <DD>Loads the configuration information and returns that |
| information as an ExtendedProperties, which will be used to |
| initialize the Velocity runtime. |
| <br><br> |
| Currently, this method gets the initialization parameter |
| VelocityServlet.INIT_PROPS_KEY, which should be a file containing |
| the configuration information. |
| <br><br> |
| To configure your Servlet Spec 2.2 compliant servlet runner to pass |
| this to you, put the following in your WEB-INF/web.xml file |
| <br> |
| <pre> |
| <servlet> |
| <servlet-name> YourServlet </servlet-name> |
| <servlet-class> your.package.YourServlet </servlet-class> |
| <init-param> |
| <param-name> org.apache.velocity.properties </param-name> |
| <param-value> velocity.properties </param-value> |
| </init-param> |
| </servlet> |
| </pre> |
| |
| Alternately, if you wish to configure an entire context in this |
| fashion, you may use the following: |
| <br> |
| <pre> |
| <context-param> |
| <param-name> org.apache.velocity.properties </param-name> |
| <param-value> velocity.properties </param-value> |
| <description> Path to Velocity configuration </description> |
| </context-param> |
| </pre> |
| |
| Derived classes may do the same, or take advantage of this code to do the loading for them via : |
| <pre> |
| ExtendedProperties p = super.loadConfiguration(config); |
| </pre> |
| and then add or modify the configuration values from the file. |
| <br>
|
| <P>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>config</CODE> - ServletConfig passed to the servlets init() function |
| Can be used to access the real path via ServletContext (hint) |
| <DT><B>Returns:</B><DD>ExtendedProperties loaded with configuration values to be used |
| to initialize the Velocity runtime. |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.IOException</CODE> - I/O problem accessing the specified file, if specified.</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)"><!-- --></A><H3>
|
| doGet</H3>
|
| <PRE>
|
| public void <B>doGet</B>(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response) |
| throws javax.servlet.ServletException, |
| java.io.IOException</PRE>
|
| <DL>
|
| <DD>Handles GET - calls doRequest()
|
| <P>
|
| <DD><DL>
|
| |
| <DT><B>Throws:</B> |
| <DD><CODE>javax.servlet.ServletException</CODE> |
| <DD><CODE>java.io.IOException</CODE></DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)"><!-- --></A><H3>
|
| doPost</H3>
|
| <PRE>
|
| public void <B>doPost</B>(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response) |
| throws javax.servlet.ServletException, |
| java.io.IOException</PRE>
|
| <DL>
|
| <DD>Handle a POST request - calls doRequest()
|
| <P>
|
| <DD><DL>
|
| |
| <DT><B>Throws:</B> |
| <DD><CODE>javax.servlet.ServletException</CODE> |
| <DD><CODE>java.io.IOException</CODE></DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="doRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)"><!-- --></A><H3>
|
| doRequest</H3>
|
| <PRE>
|
| protected void <B>doRequest</B>(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response) |
| throws javax.servlet.ServletException, |
| java.io.IOException</PRE>
|
| <DL>
|
| <DD>Handles with both GET and POST requests
|
| <P>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>request</CODE> - HttpServletRequest object containing client request<DD><CODE>response</CODE> - HttpServletResponse object for the response |
| <DT><B>Throws:</B> |
| <DD><CODE>javax.servlet.ServletException</CODE> |
| <DD><CODE>java.io.IOException</CODE></DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="requestCleanup(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.velocity.context.Context)"><!-- --></A><H3>
|
| requestCleanup</H3>
|
| <PRE>
|
| protected void <B>requestCleanup</B>(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response, |
| org.apache.velocity.context.Context context)</PRE>
|
| <DL>
|
| <DD>Cleanup routine called at the end of the request processing sequence |
| allows a derived class to do resource cleanup or other end of |
| process cycle tasks. This default implementation does nothing.
|
| <P>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>request</CODE> - servlet request from client<DD><CODE>response</CODE> - servlet reponse<DD><CODE>context</CODE> - Context created by the <A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#createContext(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)"><CODE>createContext(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)</CODE></A></DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="handleRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.velocity.context.Context)"><!-- --></A><H3>
|
| handleRequest</H3>
|
| <PRE>
|
| protected org.apache.velocity.Template <B>handleRequest</B>(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response, |
| org.apache.velocity.context.Context ctx) |
| throws java.lang.Exception</PRE>
|
| <DL>
|
| <DD><p>Handle the template processing request.</p>
|
| <P>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>request</CODE> - client request<DD><CODE>response</CODE> - client response<DD><CODE>ctx</CODE> - VelocityContext to fill |
| <DT><B>Returns:</B><DD>Velocity Template object or null |
| <DT><B>Throws:</B> |
| <DD><CODE>java.lang.Exception</CODE></DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="setContentType(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)"><!-- --></A><H3>
|
| setContentType</H3>
|
| <PRE>
|
| protected void <B>setContentType</B>(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response)</PRE>
|
| <DL>
|
| <DD>Sets the content type of the response. This is available to be overriden |
| by a derived class. |
| |
| <p>The default implementation is : |
| <pre> |
| |
| response.setContentType(defaultContentType); |
| |
| </pre> |
| where defaultContentType is set to the value of the default.contentType |
| property, or "text/html" if that is not set.</p>
|
| <P>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>request</CODE> - servlet request from client<DD><CODE>response</CODE> - servlet reponse to client</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="createContext(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)"><!-- --></A><H3>
|
| createContext</H3>
|
| <PRE>
|
| protected org.apache.velocity.context.Context <B>createContext</B>(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response)</PRE>
|
| <DL>
|
| <DD><p>Creates and returns an initialized Velocity context.</p> |
| |
| A new context of class <A HREF="../../../../../../org/apache/velocity/tools/view/context/ChainedContext.html" title="class in org.apache.velocity.tools.view.context"><CODE>ChainedContext</CODE></A> is created and |
| initialized.
|
| <P>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>request</CODE> - servlet request from client<DD><CODE>response</CODE> - servlet reponse to client</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getTemplate(java.lang.String)"><!-- --></A><H3>
|
| getTemplate</H3>
|
| <PRE>
|
| public org.apache.velocity.Template <B>getTemplate</B>(java.lang.String name) |
| throws org.apache.velocity.exception.ResourceNotFoundException, |
| org.apache.velocity.exception.ParseErrorException, |
| java.lang.Exception</PRE>
|
| <DL>
|
| <DD>Retrieves the requested template.
|
| <P>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>name</CODE> - The file name of the template to retrieve relative to the |
| template root. |
| <DT><B>Returns:</B><DD>The requested template. |
| <DT><B>Throws:</B> |
| <DD><CODE>org.apache.velocity.exception.ResourceNotFoundException</CODE> - if template not found |
| from any available source. |
| <DD><CODE>org.apache.velocity.exception.ParseErrorException</CODE> - if template cannot be parsed due |
| to syntax (or other) error. |
| <DD><CODE>java.lang.Exception</CODE> - if an error occurs in template initialization</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getTemplate(java.lang.String, java.lang.String)"><!-- --></A><H3>
|
| getTemplate</H3>
|
| <PRE>
|
| public org.apache.velocity.Template <B>getTemplate</B>(java.lang.String name, |
| java.lang.String encoding) |
| throws org.apache.velocity.exception.ResourceNotFoundException, |
| org.apache.velocity.exception.ParseErrorException, |
| java.lang.Exception</PRE>
|
| <DL>
|
| <DD>Retrieves the requested template with the specified character encoding.
|
| <P>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>name</CODE> - The file name of the template to retrieve relative to the |
| template root.<DD><CODE>encoding</CODE> - the character encoding of the template |
| <DT><B>Returns:</B><DD>The requested template. |
| <DT><B>Throws:</B> |
| <DD><CODE>org.apache.velocity.exception.ResourceNotFoundException</CODE> - if template not found |
| from any available source. |
| <DD><CODE>org.apache.velocity.exception.ParseErrorException</CODE> - if template cannot be parsed due |
| to syntax (or other) error. |
| <DD><CODE>java.lang.Exception</CODE> - if an error occurs in template initialization</DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="mergeTemplate(org.apache.velocity.Template, org.apache.velocity.context.Context, javax.servlet.http.HttpServletResponse)"><!-- --></A><H3>
|
| mergeTemplate</H3>
|
| <PRE>
|
| protected void <B>mergeTemplate</B>(org.apache.velocity.Template template, |
| org.apache.velocity.context.Context context, |
| javax.servlet.http.HttpServletResponse response) |
| throws org.apache.velocity.exception.ResourceNotFoundException, |
| org.apache.velocity.exception.ParseErrorException, |
| org.apache.velocity.exception.MethodInvocationException, |
| java.io.IOException, |
| java.io.UnsupportedEncodingException, |
| java.lang.Exception</PRE>
|
| <DL>
|
| <DD>Merges the template with the context. Only override this if you really, really |
| really need to. (And don't call us with questions if it breaks :)
|
| <P>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>template</CODE> - template object returned by the handleRequest() method<DD><CODE>context</CODE> - Context created by the <A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#createContext(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)"><CODE>createContext(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)</CODE></A><DD><CODE>response</CODE> - servlet reponse (used to get a Writer) |
| <DT><B>Throws:</B> |
| <DD><CODE>org.apache.velocity.exception.ResourceNotFoundException</CODE> |
| <DD><CODE>org.apache.velocity.exception.ParseErrorException</CODE> |
| <DD><CODE>org.apache.velocity.exception.MethodInvocationException</CODE> |
| <DD><CODE>java.io.IOException</CODE> |
| <DD><CODE>java.io.UnsupportedEncodingException</CODE> |
| <DD><CODE>java.lang.Exception</CODE></DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="performMerge(org.apache.velocity.Template, org.apache.velocity.context.Context, java.io.Writer)"><!-- --></A><H3>
|
| performMerge</H3>
|
| <PRE>
|
| protected void <B>performMerge</B>(org.apache.velocity.Template template, |
| org.apache.velocity.context.Context context, |
| java.io.Writer writer) |
| throws org.apache.velocity.exception.ResourceNotFoundException, |
| org.apache.velocity.exception.ParseErrorException, |
| org.apache.velocity.exception.MethodInvocationException, |
| java.lang.Exception</PRE>
|
| <DL>
|
| <DD>This is here so developers may override it and gain access to the |
| Writer which the template will be merged into. See |
| <a href="http://issues.apache.org/jira/browse/VELTOOLS-7">VELTOOLS-7</a> |
| for discussion of this.
|
| <P>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>template</CODE> - template object returned by the handleRequest() method<DD><CODE>context</CODE> - Context created by the <A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityViewServlet.html#createContext(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)"><CODE>createContext(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)</CODE></A><DD><CODE>writer</CODE> - a VelocityWriter that the template is merged into |
| <DT><B>Throws:</B> |
| <DD><CODE>org.apache.velocity.exception.ResourceNotFoundException</CODE> |
| <DD><CODE>org.apache.velocity.exception.ParseErrorException</CODE> |
| <DD><CODE>org.apache.velocity.exception.MethodInvocationException</CODE> |
| <DD><CODE>java.lang.Exception</CODE></DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="error(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Exception)"><!-- --></A><H3>
|
| error</H3>
|
| <PRE>
|
| protected void <B>error</B>(javax.servlet.http.HttpServletRequest request, |
| javax.servlet.http.HttpServletResponse response, |
| java.lang.Exception e) |
| throws javax.servlet.ServletException</PRE>
|
| <DL>
|
| <DD>Invoked when there is an error thrown in any part of doRequest() processing. |
| <br><br> |
| Default will send a simple HTML response indicating there was a problem.
|
| <P>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>request</CODE> - original HttpServletRequest from servlet container.<DD><CODE>response</CODE> - HttpServletResponse object from servlet container.<DD><CODE>e</CODE> - Exception that was thrown by some other part of process. |
| <DT><B>Throws:</B> |
| <DD><CODE>javax.servlet.ServletException</CODE></DL>
|
| </DD>
|
| </DL>
|
| <HR>
|
|
|
| <A NAME="getResponseWriter(javax.servlet.http.HttpServletResponse)"><!-- --></A><H3>
|
| getResponseWriter</H3>
|
| <PRE>
|
| protected java.io.Writer <B>getResponseWriter</B>(javax.servlet.http.HttpServletResponse response) |
| throws java.io.UnsupportedEncodingException, |
| java.io.IOException</PRE>
|
| <DL>
|
| <DD><p>Procure a Writer with correct encoding which can be used |
| even if HttpServletResponse's <code>getOutputStream()</code> method |
| has already been called.</p> |
| |
| <p>This is a transitional method which will be removed in a |
| future version of Velocity. It is not recommended that you |
| override this method.</p>
|
| <P>
|
| <DD><DL>
|
| <DT><B>Parameters:</B><DD><CODE>response</CODE> - The response. |
| <DT><B>Returns:</B><DD>A <code>Writer</code>, possibly created using the |
| <code>getOutputStream()</code>. |
| <DT><B>Throws:</B> |
| <DD><CODE>java.io.UnsupportedEncodingException</CODE> |
| <DD><CODE>java.io.IOException</CODE></DL>
|
| </DD>
|
| </DL>
|
| <!-- ========= END OF CLASS DATA ========= -->
|
| <HR>
|
|
|
| |
| <!-- ======= START OF BOTTOM NAVBAR ====== -->
|
| <A NAME="navbar_bottom"><!-- --></A> |
| <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
| <TR>
|
| <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
| <A NAME="navbar_bottom_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
| <TR ALIGN="center" VALIGN="top">
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
| </TR>
|
| </TABLE>
|
| </TD>
|
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
| </EM>
|
| </TD>
|
| </TR>
|
|
|
| <TR>
|
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
| <A HREF="../../../../../../org/apache/velocity/tools/view/servlet/VelocityLayoutServlet.html" title="class in org.apache.velocity.tools.view.servlet"><B>PREV CLASS</B></A>
|
| <A HREF="../../../../../../org/apache/velocity/tools/view/servlet/WebappLoader.html" title="class in org.apache.velocity.tools.view.servlet"><B>NEXT CLASS</B></A></FONT></TD>
|
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
| <A HREF="../../../../../../index.html" target="_top"><B>FRAMES</B></A>
|
| <A HREF="VelocityViewServlet.html" target="_top"><B>NO FRAMES</B></A>
|
| <SCRIPT type="text/javascript">
|
| <!--
|
| if(window==top) {
|
| document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
|
| }
|
| //-->
|
| </SCRIPT>
|
| <NOSCRIPT>
|
| <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
|
| </NOSCRIPT> |
|
|
| </FONT></TD>
|
| </TR>
|
| <TR>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
| DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
| </TR>
|
| </TABLE>
|
| <A NAME="skip-navbar_bottom"></A> |
| <!-- ======== END OF BOTTOM NAVBAR ======= -->
|
|
|
| <HR>
|
| Copyright (c) 2003 Apache Software Foundation
|
| </BODY>
|
| </HTML>
|