Package org.apache.velocity.tools.view
Class ServletUtils
java.lang.Object
org.apache.velocity.tools.view.ServletUtils
- Direct Known Subclasses:
ServletUtils
A set of utility methods for supporting and using VelocityTools in the servlet environment.
- Version:
- $Id: ServletUtils.java 471244 2006-11-04 18:34:38Z henning $
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
Key used to access a liveFactoryConfiguration
previously placed in the ServletContext attributes.static final ServletUtils
static final String
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static VelocityView
createView
(Class klass, JeeConfig config) private static VelocityView
createView
(JeeConfig config) static Object
static Object
static Object
static Object
static Object
static Object
static FactoryConfiguration
getConfiguration
(String path, ServletContext application) static FactoryConfiguration
getConfiguration
(String path, ServletContext application, boolean deprecationSupportMode) static FactoryConfiguration
getConfiguration
(ServletContext application) static InputStream
getInputStream
(String path, ServletContext application) static Object
Returns a mutex (lock object) unique to the specified session and stored under the specified key to allow for reliable synchronization on the session.static String
getPath
(HttpServletRequest request) Retrieves the path for the specified request regardless of whether this is a direct request or an include by the RequestDispatcher.static VelocityView
getVelocityView
(FilterConfig config) Returns the sharedVelocityView
for the specifiedFilterConfig
's context.static VelocityView
getVelocityView
(ServletConfig config) Returns the sharedVelocityView
for the specifiedServletConfig
's context.static VelocityView
getVelocityView
(ServletContext application) Returns the sharedVelocityView
for the specifiedServletContext
.static VelocityView
getVelocityView
(ServletContext application, boolean createIfMissing) Returns the sharedVelocityView
for the specifiedServletContext
.
-
Field Details
-
VELOCITY_VIEW_KEY
-
SHARED_CONFIG_PARAM
- See Also:
-
ALT_VELOCITY_VIEW_KEY
- See Also:
-
CONFIGURATION_KEY
Key used to access a liveFactoryConfiguration
previously placed in the ServletContext attributes.- See Also:
-
INSTANCE
-
-
Constructor Details
-
ServletUtils
protected ServletUtils()
-
-
Method Details
-
getInstance
-
getPath
Retrieves the path for the specified request regardless of whether this is a direct request or an include by the RequestDispatcher. -
getVelocityView
Returns the sharedVelocityView
for the specifiedServletConfig
's context. If one has not yet been created, it will create, store it for future access, and then return it. -
getVelocityView
Returns the sharedVelocityView
for the specifiedFilterConfig
's context. If one has not yet been created, it will create, store it for future access, and then return it. -
createView
-
createView
-
getVelocityView
Returns the sharedVelocityView
for the specifiedServletContext
. If one has not yet been created, it will create one, store it for future access, and then return it. -
getVelocityView
Returns the sharedVelocityView
for the specifiedServletContext
. If one has not yet been created and the second parameter istrue
, then it will create one, store it for future access, and return it. -
findTool
-
findTool
-
findTool
-
findTool
-
findTool
-
findTool
-
getInputStream
-
getConfiguration
-
getConfiguration
-
getConfiguration
public static FactoryConfiguration getConfiguration(String path, ServletContext application, boolean deprecationSupportMode) -
getMutex
Returns a mutex (lock object) unique to the specified session and stored under the specified key to allow for reliable synchronization on the session.
-