public class RequestDispatcherOptions
extends java.util.HashMap<java.lang.String,java.lang.String>
RequestDispatcherOptions
are used in the
SlingHttpServletRequest.getRequestDispatcher(org.apache.sling.api.resource.Resource, RequestDispatcherOptions)
method, to give more control on some aspects of the include/forward
mechanism. Typical use cases include:
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
OPT_ADD_SELECTORS
When dispatching, add the value provided by this option to the
RequestPathInfo selectors. |
static java.lang.String |
OPT_FORCE_RESOURCE_TYPE
When dispatching, use the value provided by this option as the resource
type, instead of the one defined by the
Resource . |
static java.lang.String |
OPT_REPLACE_SELECTORS
When dispatching, replace
RequestPathInfo selectors by the value
provided by this option. |
static java.lang.String |
OPT_REPLACE_SUFFIX
When dispatching, replace the
RequestPathInfo suffix by the value
provided by this option |
Constructor and Description |
---|
RequestDispatcherOptions()
Creates an instance with no options set.
|
RequestDispatcherOptions(java.lang.String options)
Creates a new instances setting options by parsing the given
options string as follows:
If the string is empty or null no options are set.
If the string neither contains a comma nor an equals sign, the
string is assumed to be a resource type. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAddSelectors()
Returns the
OPT_ADD_SELECTORS option or null if
not set. |
java.lang.String |
getForceResourceType()
Returns the
OPT_FORCE_RESOURCE_TYPE option or null
if not set. |
java.lang.String |
getReplaceSelectors()
Returns the
OPT_REPLACE_SELECTORS option or null
if not set. |
java.lang.String |
getReplaceSuffix()
Returns the
OPT_REPLACE_SUFFIX option or null if
not set. |
void |
setAddSelectors(java.lang.String additionalSelectors)
|
void |
setForceResourceType(java.lang.String resourceType)
|
void |
setReplaceSelectors(java.lang.String replaceSelectors)
|
void |
setReplaceSuffix(java.lang.String replaceSuffix)
|
public static final java.lang.String OPT_FORCE_RESOURCE_TYPE
Resource
.public static final java.lang.String OPT_REPLACE_SELECTORS
RequestPathInfo
selectors by the value
provided by this option. If this value contains an empty string, all
original selectors are removed.public static final java.lang.String OPT_ADD_SELECTORS
RequestPathInfo
selectors.public static final java.lang.String OPT_REPLACE_SUFFIX
RequestPathInfo
suffix by the value
provided by this optionpublic RequestDispatcherOptions()
public RequestDispatcherOptions(java.lang.String options)
options
string as follows:
null
no options are set.RequestDispatcherOptions
object is created with the
OPT_FORCE_RESOURCE_TYPE
field set to the
string.RequestDispatcherOptions
object is created
from the name value pair list.options
- The options to set.public void setForceResourceType(java.lang.String resourceType)
resourceType
- the resource typepublic java.lang.String getForceResourceType()
OPT_FORCE_RESOURCE_TYPE
option or null
if not set.public void setAddSelectors(java.lang.String additionalSelectors)
additionalSelectors
- The add selectorspublic java.lang.String getAddSelectors()
OPT_ADD_SELECTORS
option or null
if
not set.public void setReplaceSelectors(java.lang.String replaceSelectors)
OPT_REPLACE_SELECTORS
option to the given
replaceSelectors
if not null
.
If this value contains an empty string, all
original selectors are removed.replaceSelectors
- The replace selectors.public java.lang.String getReplaceSelectors()
OPT_REPLACE_SELECTORS
option or null
if not set.public void setReplaceSuffix(java.lang.String replaceSuffix)
replaceSuffix
- The replace suffixpublic java.lang.String getReplaceSuffix()
OPT_REPLACE_SUFFIX
option or null
if
not set."Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"