|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.shell.support.util.WebXmlUtils
public final class WebXmlUtils
Helper util class to allow more convenient handling of web.xml file in Web projects.
Nested Class Summary | |
---|---|
static class |
WebXmlUtils.Dispatcher
Enum to define dispatcher |
static class |
WebXmlUtils.FilterPosition
Enum to define filter position |
static class |
WebXmlUtils.WebResourceCollection
Convenience class for passing a web-resource-collection element's details |
static class |
WebXmlUtils.WebXmlParam
Value object that holds init-param style information |
Method Summary | |
---|---|
static void |
addContextParam(WebXmlUtils.WebXmlParam contextParam,
Document document,
String comment)
Add a context param to the web.xml document |
static void |
addErrorCode(Integer errorCode,
String location,
Document document,
String comment)
Add error code to web.xml document |
static void |
addExceptionType(String exceptionType,
String location,
Document document,
String comment)
Add exception type to web.xml document |
static void |
addFilter(String filterName,
String filterClass,
String urlPattern,
Document document,
String comment,
WebXmlUtils.WebXmlParam... initParams)
Add a new filter definition to web.xml document. |
static void |
addFilterAtPosition(WebXmlUtils.FilterPosition filterPosition,
String afterFilterName,
String beforeFilterName,
String filterName,
String filterClass,
String urlPattern,
Document document,
String comment,
List<WebXmlUtils.WebXmlParam> initParams,
List<WebXmlUtils.Dispatcher> dispatchers)
Add a new filter definition to web.xml document. |
static void |
addFilterAtPosition(WebXmlUtils.FilterPosition filterPosition,
String afterFilterName,
String beforeFilterName,
String filterName,
String filterClass,
String urlPattern,
Document document,
String comment,
WebXmlUtils.WebXmlParam... initParams)
Add a new filter definition to web.xml document. |
static void |
addListener(String className,
Document document,
String comment)
Add listener element to web.xml document |
static void |
addSecurityConstraint(String displayName,
List<WebXmlUtils.WebResourceCollection> webResourceCollections,
List<String> roleNames,
String transportGuarantee,
Document document,
String comment)
Add a security constraint to a web.xml document |
static void |
addServlet(String servletName,
String className,
String urlPattern,
Integer loadOnStartup,
Document document,
String comment,
WebXmlUtils.WebXmlParam... initParams)
Add servlet element to the web.xml document |
static void |
addWelcomeFile(String path,
Document document,
String comment)
Add a welcome file definition to web.xml document |
static void |
setDescription(String description,
Document document,
String comment)
Set the description element in the web.xml document. |
static void |
setDisplayName(String displayName,
Document document,
String comment)
Set the display-name element in the web.xml document. |
static void |
setSessionTimeout(int timeout,
Document document,
String comment)
Set session timeout in web.xml document |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void setDisplayName(String displayName, Document document, String comment)
displayName
- (required)document
- the web.xml document (required)comment
- (optional)public static void setDescription(String description, Document document, String comment)
description
- (required)document
- the web.xml document (required)comment
- (optional)public static void addContextParam(WebXmlUtils.WebXmlParam contextParam, Document document, String comment)
contextParam
- (required)document
- the web.xml document (required)comment
- (optional)public static void addFilter(String filterName, String filterClass, String urlPattern, Document document, String comment, WebXmlUtils.WebXmlParam... initParams)
filterName
- (required)filterClass
- the fully qualified name of the filter type (required)urlPattern
- (required)document
- the web.xml document (required)comment
- (optional)initParams
- a vararg of initial parameters (optional)public static void addFilterAtPosition(WebXmlUtils.FilterPosition filterPosition, String afterFilterName, String beforeFilterName, String filterName, String filterClass, String urlPattern, Document document, String comment, WebXmlUtils.WebXmlParam... initParams)
filterPosition
- Filter position (required)beforeFilterName
- (optional for filter position FIRST and LAST, required for BEFORE and AFTER)filterName
- (required)filterClass
- the fully qualified name of the filter type (required)urlPattern
- (required)document
- the web.xml document (required)comment
- (optional)initParams
- (optional)public static void addFilterAtPosition(WebXmlUtils.FilterPosition filterPosition, String afterFilterName, String beforeFilterName, String filterName, String filterClass, String urlPattern, Document document, String comment, List<WebXmlUtils.WebXmlParam> initParams, List<WebXmlUtils.Dispatcher> dispatchers)
filterPosition
- Filter position (required)beforeFilterName
- (optional for filter position FIRST and LAST, required for BEFORE and AFTER)filterName
- (required)filterClass
- the fully qualified name of the filter type (required)urlPattern
- (required)document
- the web.xml document (required)comment
- (optional)initParams
- (optional)dispatchers
- (optional)public static void addListener(String className, Document document, String comment)
className
- the fully qualified name of the listener type (required)document
- (required)comment
- (optional)public static void addServlet(String servletName, String className, String urlPattern, Integer loadOnStartup, Document document, String comment, WebXmlUtils.WebXmlParam... initParams)
servletName
- (required)className
- the fully qualified name of the servlet type (required)urlPattern
- this can be set to null in which case the servletName will be used for mapping (optional)loadOnStartup
- (optional)document
- (required)comment
- (optional)initParams
- (optional)public static void setSessionTimeout(int timeout, Document document, String comment)
timeout
- document
- (required)comment
- (optional)public static void addWelcomeFile(String path, Document document, String comment)
path
- (required)document
- (required)comment
- (optional)public static void addExceptionType(String exceptionType, String location, Document document, String comment)
exceptionType
- fully qualified exception type name (required)location
- (required)document
- (required)comment
- (optional)public static void addErrorCode(Integer errorCode, String location, Document document, String comment)
errorCode
- (required)location
- (required)document
- (required)comment
- (optional)public static void addSecurityConstraint(String displayName, List<WebXmlUtils.WebResourceCollection> webResourceCollections, List<String> roleNames, String transportGuarantee, Document document, String comment)
displayName
- (optional)webResourceCollections
- (required)roleNames
- (optional)transportGuarantee
- (optional)document
- (required)comment
- (optional)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |