public interface ActionContext
| Modifier and Type | Field and Description |
|---|---|
static int |
APPLICATION_SCOPE
The application scope.
|
static int |
PAGE_SCOPE
The page scope.
|
static int |
REQUEST_SCOPE
The request scope.
|
static int |
SESSION_SCOPE
The session scope.
|
| Modifier and Type | Method and Description |
|---|---|
String |
encodeURL(String uri)
Encodes the specified URI.
|
Object |
findAttribute(String name)
Finds the attribute from page, request, session to application scope
|
Object |
getAttribute(String name,
int scope)
Returns the attribute of the specified scope.
|
int |
getLineNumber()
Returns the line number of this action.
|
Writer |
getOut()
Returns the current output.
|
Action |
getParent()
Returns the parent action, or null if no parent at all.
|
void |
include(String uri,
Map<?,?> params)
Includes the specified URI and render the result to the specified
output.
|
boolean |
isIncluded()
Returns whether this page is included.
|
void |
removeAttribute(String name,
int scope)
Removes the attribute of the specified scope.
|
void |
renderFragment(Writer out)
Renders the nested fragment.
|
void |
setAttribute(String name,
Object value,
int scope)
Sets the attribute of the specified scope.
|
void |
setContentType(String ctype)
Sets the content type.
|
static final int PAGE_SCOPE
static final int REQUEST_SCOPE
static final int SESSION_SCOPE
static final int APPLICATION_SCOPE
Object getAttribute(String name, int scope)
scope - one of PAGE_SCOPE, REQUEST_SCOPE,
SESSION_SCOPE and APPLICATION_SCOPE.void setAttribute(String name, Object value, int scope)
scope - one of PAGE_SCOPE, REQUEST_SCOPE,
SESSION_SCOPE and APPLICATION_SCOPE.void removeAttribute(String name, int scope)
scope - one of PAGE_SCOPE, REQUEST_SCOPE,
SESSION_SCOPE and APPLICATION_SCOPE.Object findAttribute(String name)
void setContentType(String ctype)
Writer getOut() throws IOException
IOExceptionAction getParent()
void renderFragment(Writer out) throws DspException, IOException
out - the output. If null, getOut() is assumed.DspExceptionIOExceptionvoid include(String uri, Map<?,?> params) throws DspException, IOException
uri - the URI to include. It is OK to relevant (without leading
'/'). If starts with "/", the context path of request is assumed.
To reference to foreign context, use "~ctx/" where ctx is the
context path of the foreign context (without leading '/').params - a map of parameters, or null to ignore.
The map is passed thru the request attribute called arg.DspExceptionIOExceptionboolean isIncluded()
String encodeURL(String uri) throws DspException, IOException
In additions, if uri starts with "/", the context path, e.g., /we2, is prefixed. In other words, "/ab/cd" means it is relevant to the servlet context path (say, "/we2").
If uri starts with "~abc/", it means it is relevant to a foreign context called /abc. And, it will be converted to "/abc/" first (without prefix request.getContextPath()).
Finally, the uri is encoded by HttpServletResponse.encodeURL.
DspExceptionIOExceptionint getLineNumber()
Copyright © 2021. All rights reserved.