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.getContextPath()
RestRequest.getMethod()
RestRequest.getMethodDescription()
RestRequest.getMethodSummary()
HttpServletRequestWrapper.getPathInfo()
UriContext.getRootRelativePathInfoParent()
HttpServletRequestWrapper.getRequestURI()
RestRequest.getResourceDescription()
RestRequest.getResourceTitle()
UriContext.getRootRelativeServletPathParent()
RestRequest.getServletPath()
UriContext.getRootRelativeServletPath()
RestRequest.getSiteName()
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.
|
static String |
SESSION_req
The name of the session or context object that identifies the
RestRequest object. |
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.
|
String |
resolve(VarResolverSession session,
String key)
The interface that needs to be implemented for subclasses of
SimpleVar . |
doResolve
public static final String SESSION_req
RestRequest
object.public static final String NAME
public RequestVar()
protected boolean allowNested()
Var
For example, in
The default implementation of this method always returns
allowNested
in class Var
protected 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 Var
Copyright © 2018 Apache. All rights reserved.