public class RequestVar extends MultipartResolvingVar
The format for this var is
When multiple keys are used, returns the first non-null/empty value.
The possible values are:
RestRequest.getAuthorityPath()
RestRequest.getContextPath()
RestRequest.getMethod()
RestRequest.getMethodDescription()
RestRequest.getMethodSummary()
HttpServletRequestWrapper.getPathInfo()
UriContext.getRootRelativePathInfoParent()
HttpServletRequestWrapper.getRequestURI()
RestRequest.getResourceDescription()
RestRequest.getResourceTitle()
UriContext.getRootRelativeServletPathParent()
RestRequest.getServletPath()
UriContext.getRootRelativeServletPath()
String resourceTitle = restRequest.resolveVars(
RestRequest object be set as a context object on the resolver
or a session object on the resolver session.
| Modifier and Type | Field and Description |
|---|---|
static String |
NAME
The name of this variable.
|
| Constructor and Description |
|---|
RequestVar()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
allowNested()
Returns whether nested variables are supported by this variable.
|
protected boolean |
allowRecurse()
Returns whether variables in the resolved contents of this variable should also be resolved.
|
boolean |
canResolve(VarResolverSession session)
Returns
|
String |
resolve(VarResolverSession session,
String key)
The interface that needs to be implemented for subclasses of
SimpleVar. |
doResolvepublic static final String NAME
public RequestVar()
protected boolean allowNested()
Var
For example, in
The default implementation of this method always returns
allowNested in class Varprotected boolean allowRecurse()
Var
For example, if
The default implementation of this method always returns
Subclasses can override this method to override the default behavior.
As a general rule, variables that resolve user-entered data should not be recursively resolved as this may cause a security hole.
allowRecurse in class Varpublic String resolve(VarResolverSession session, String key)
VarSimpleVar.public boolean canResolve(VarResolverSession session)
VarFor example, some variable cannot resolve unless specific context or session objects are available.
canResolve in class Varsession - The current session.Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.