|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--javax.servlet.GenericServlet
|
+--javax.servlet.http.HttpServlet
|
+--org.apache.velocity.servlet.VelocityServlet
|
+--org.apache.velocity.test.VelocityServletTest.MockVelocityServlet
| Fields inherited from class org.apache.velocity.servlet.VelocityServlet |
CONTENT_TYPE, DEFAULT_CONTENT_TYPE, DEFAULT_OUTPUT_ENCODING, defaultContentType, INIT_PROPS_KEY, OLD_INIT_PROPS_KEY, REQUEST, RESPONSE, writerPool |
| Fields inherited from class javax.servlet.http.HttpServlet |
HEADER_IFMODSINCE, HEADER_LASTMOD, LSTRING_FILE, lStrings, METHOD_DELETE, METHOD_GET, METHOD_HEAD, METHOD_OPTIONS, METHOD_POST, METHOD_PUT, METHOD_TRACE |
| Fields inherited from class javax.servlet.GenericServlet |
config |
| Constructor Summary | |
(package private) |
VelocityServletTest.MockVelocityServlet()
|
| Method Summary | |
javax.servlet.ServletConfig |
getServletConfig()
|
protected java.util.Properties |
loadConfiguration(javax.servlet.ServletConfig config)
Loads the configuration information and returns that information as a Properties, which will be used to initialize the Velocity runtime. |
(package private) void |
visibleSetContentType(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
|
| Methods inherited from class org.apache.velocity.servlet.VelocityServlet |
chooseCharacterEncoding, createContext, doGet, doPost, doRequest, error, getTemplate, getTemplate, handleRequest, handleRequest, init, initVelocity, mergeTemplate, requestCleanup, setContentType |
| Methods inherited from class javax.servlet.http.HttpServlet |
|
| Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletContext, getServletInfo, getServletName, init, log, log |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
| Constructor Detail |
VelocityServletTest.MockVelocityServlet()
| Method Detail |
void visibleSetContentType(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
protected java.util.Properties loadConfiguration(javax.servlet.ServletConfig config)
throws java.io.IOException
VelocityServlet
<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>
Alternately, if you wish to configure an entire context in this
fashion, you may use the following:
<context-param>
<param-name> org.apache.velocity.properties </param-name>
<param-value> velocity.properties </param-value>
<description> Path to Velocity configuration </description>
</context-param>
Derived classes may do the same, or take advantage of this code to do the loading for them via :
Properties p = super.loadConfiguration( config );
and then add or modify the configuration values from the file.
loadConfiguration in class VelocityServletorg.apache.velocity.servlet.VelocityServletconfig - ServletConfig passed to the servlets init() function
Can be used to access the real path via ServletContext (hint)java.io.FileNotFoundException - if a specified file is not found.java.io.IOException - I/O problem accessing the specified file, if specified.public javax.servlet.ServletConfig getServletConfig()
getServletConfig in class javax.servlet.GenericServlet
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||