|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.veriplace.web.servlet.VeriplaceServletHelper
public class VeriplaceServletHelper
Provides static methods for configuring com.veriplace.web objects in a servlet environment.
These methods look for the following context-param elements in your web.xml configuration:
| Field Summary | |
|---|---|
static java.lang.String |
PROPERTIES_FILE_CONTEXT_PARAM
|
static java.lang.String |
STATE_ATTRIBUTE_CONTEXT_PARAM
|
static java.lang.String |
VIEW_PREFIX_CONTEXT_PARAM
|
static java.lang.String |
VIEW_SUFFIX_CONTEXT_PARAM
|
| Constructor Summary | |
|---|---|
VeriplaceServletHelper()
|
|
| Method Summary | |
|---|---|
static Veriplace |
getSharedVeriplaceInstance(Servlet servlet)
Returns a Veriplace instance for the given servlet, if one has already been
created by a previous call to getSharedVeriplaceInstance(Servlet, String, String); otherwise
returns null. |
static Veriplace |
getSharedVeriplaceInstance(ServletContext servletContext)
Creates or returns a Veriplace instance for the given ServletContext,
using the properties file whose name is in the context parameter "veriplace.properties-file". |
static Veriplace |
getSharedVeriplaceInstance(ServletContext servletContext,
java.util.Properties properties)
Creates or returns a Veriplace instance for the given ServletContext, which
will be shared by all servlets within the same application. |
static Veriplace |
getSharedVeriplaceInstance(ServletContext servletContext,
java.lang.String propertiesFileName)
Creates or returns a Veriplace instance for the given ServletContext, which
will be shared by all servlets within the same application. |
static Veriplace |
getSharedVeriplaceInstance(Servlet servlet,
java.lang.String propertiesFileName,
java.lang.String viewPrefix)
Creates or returns a Veriplace instance for the given servlet. |
static java.util.Properties |
getSharedVeriplaceProperties(ServletContext servletContext)
Returns the properties that were used to configure the Veriplace instance for the current servlet. |
static ServletStatusViewRenderer |
getViewRendererFromViewParams(ServletContext sc,
java.lang.String paramsName)
Creates a StatusViewRenderer using a set of servlet context parameters, as follows
(where NAME is the string passed to this method):
veriplace.views.NAME.prefix: path/prefix to view names (e.g. |
protected static void |
useContext(ServletContext sc,
Veriplace v,
java.util.Properties properties)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROPERTIES_FILE_CONTEXT_PARAM
public static final java.lang.String VIEW_PREFIX_CONTEXT_PARAM
public static final java.lang.String VIEW_SUFFIX_CONTEXT_PARAM
public static final java.lang.String STATE_ATTRIBUTE_CONTEXT_PARAM
| Constructor Detail |
|---|
public VeriplaceServletHelper()
| Method Detail |
|---|
public static Veriplace getSharedVeriplaceInstance(ServletContext servletContext)
throws java.io.IOException,
ConfigurationException
Veriplace instance for the given ServletContext,
using the properties file whose name is in the context parameter "veriplace.properties-file".
servletContext - the current ServletContext
java.io.IOException - if the properties file could not be read
ConfigurationException - if the Veriplace client could not be created
public static Veriplace getSharedVeriplaceInstance(ServletContext servletContext,
java.lang.String propertiesFileName)
throws java.io.IOException,
ConfigurationException
Veriplace instance for the given ServletContext, which
will be shared by all servlets within the same application.
servletContext - the current ServletContextpropertiesFileName - path of the properties file
java.io.IOException - if the properties file could not be read
ConfigurationException - if the Veriplace client could not be created
public static Veriplace getSharedVeriplaceInstance(ServletContext servletContext,
java.util.Properties properties)
throws ConfigurationException
Veriplace instance for the given ServletContext, which
will be shared by all servlets within the same application.
servletContext - the current ServletContextproperties - properties for initializing the Veriplace client
ConfigurationException - if the Veriplace client could not be created
public static Veriplace getSharedVeriplaceInstance(Servlet servlet,
java.lang.String propertiesFileName,
java.lang.String viewPrefix)
throws java.io.IOException,
ConfigurationException
Veriplace instance for the given servlet. The object is
associated with the ServletContext, so it is shared by all servlets within the same application.
This method is mainly useful for code that is executed by a non-extensible servlet class, such as a
JSP.
servlet - an active servletpropertiesFileName - path of the properties fileviewPrefix - path to any status pages that Veriplace may need to display (a shortcut for
initializing this commonly used property of ServletStatusViewRenderer)
java.io.IOException - if the properties file could not be read
ConfigurationException - if the Veriplace client could not be created
public static Veriplace getSharedVeriplaceInstance(Servlet servlet)
throws java.io.IOException,
ConfigurationException
Veriplace instance for the given servlet, if one has already been
created by a previous call to getSharedVeriplaceInstance(Servlet, String, String); otherwise
returns null.
java.io.IOException
ConfigurationException
public static java.util.Properties getSharedVeriplaceProperties(ServletContext servletContext)
throws ConfigurationException
ConfigurationException - if the properties file was not specified or could not be read
public static ServletStatusViewRenderer getViewRendererFromViewParams(ServletContext sc,
java.lang.String paramsName)
StatusViewRenderer using a set of servlet context parameters, as follows
(where NAME is the string passed to this method):
protected static void useContext(ServletContext sc,
Veriplace v,
java.util.Properties properties)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||