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 Stringstatic final StringKey used to access a liveFactoryConfigurationpreviously placed in the ServletContext attributes.static final ServletUtilsstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static VelocityViewcreateView(Class klass, JeeConfig config) private static VelocityViewcreateView(JeeConfig config) static Objectstatic Objectstatic Objectstatic Objectstatic Objectstatic Objectstatic FactoryConfigurationgetConfiguration(String path, ServletContext application) static FactoryConfigurationgetConfiguration(String path, ServletContext application, boolean deprecationSupportMode) static FactoryConfigurationgetConfiguration(ServletContext application) static InputStreamgetInputStream(String path, ServletContext application) static ObjectReturns a mutex (lock object) unique to the specified session and stored under the specified key to allow for reliable synchronization on the session.static StringgetPath(HttpServletRequest request) Retrieves the path for the specified request regardless of whether this is a direct request or an include by the RequestDispatcher.static VelocityViewgetVelocityView(FilterConfig config) Returns the sharedVelocityViewfor the specifiedFilterConfig's context.static VelocityViewgetVelocityView(ServletConfig config) Returns the sharedVelocityViewfor the specifiedServletConfig's context.static VelocityViewgetVelocityView(ServletContext application) Returns the sharedVelocityViewfor the specifiedServletContext.static VelocityViewgetVelocityView(ServletContext application, boolean createIfMissing) Returns the sharedVelocityViewfor 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 liveFactoryConfigurationpreviously 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 sharedVelocityViewfor 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 sharedVelocityViewfor 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 sharedVelocityViewfor 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 sharedVelocityViewfor 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.
-