org.apache.struts.config
public class ConfigHelper extends java.lang.Object implements ConfigHelperInterface
Modifier and Type | Field and Description |
---|---|
private javax.servlet.ServletContext |
application
The application associated with this instance.
|
private ActionForward |
forward
The forward associated with this instance.
|
private javax.servlet.http.HttpServletRequest |
request
The request associated with this instance.
|
private javax.servlet.http.HttpServletResponse |
response
The response associated with this instance.
|
private javax.servlet.http.HttpSession |
session
The session associated with this instance.
|
Constructor and Description |
---|
ConfigHelper() |
ConfigHelper(javax.servlet.ServletContext application,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
action(java.lang.String path)
Wrapper for getAction(String)
|
java.lang.String |
getAction(java.lang.String path)
Return the URL for the specified ActionMapping,
otherwise return
null . |
ActionForm |
getActionForm() |
ActionForward |
getActionForward(java.lang.String name)
Return the forwarding associated with the specified logical name,
if any; otherwise return
null . |
ActionMapping |
getActionMapping(java.lang.String path)
Return the mapping associated with the specified request path, if any;
otherwise return
null . |
java.lang.String |
getActionMappingName(java.lang.String action)
Return the form action converted into an action mapping path.
|
java.lang.String |
getActionMappingURL(java.lang.String action)
Return the form action converted into a server-relative URL.
|
ActionMessages |
getActionMessages()
The
org.apache.struts.action.ActionFormBeans collection
for this application. |
java.lang.String |
getBaseRef()
Renders the reference for a HTML
|
javax.sql.DataSource |
getDataSource()
The default
configured data source (which must implement
javax.sql.DataSource ),
if one is configured for this application. |
java.lang.String |
getEncodeURL(java.lang.String url)
Return the url encoded to maintain the user session, if any.
|
java.lang.Throwable |
getException()
The runtime JspException that may be been thrown by a Struts tag
extension, or compatible presentation extension, and placed
in the request.
|
ActionFormBean |
getFormBean(java.lang.String name)
Return the form bean definition associated with the specified
logical name, if any; otherwise return
null . |
java.lang.String |
getLink(java.lang.String name)
Return the path for the specified forward,
otherwise return
null . |
ActionMapping |
getMapping()
The
org.apache.struts.ActionMapping
instance for this request. |
java.lang.String |
getMessage(java.lang.String key)
Return the localized message for the specified key,
otherwise return
null . |
java.lang.String |
getMessage(java.lang.String key,
java.lang.Object[] args)
Look up and return a message string, based on the specified parameters.
|
MessageResources |
getMessageResources()
The application resources for this application.
|
MultipartRequestWrapper |
getMultipartRequestWrapper()
The multipart object for this request.
|
java.lang.String |
getOrigRef()
Renders the reference for a HTML
|
java.lang.String |
getServletMapping()
The path-mapped pattern (
/action/* ) or
extension mapped pattern ((*.do )
used to determine our Action URIs in this application. |
java.lang.String |
getToken()
The transaction token stored in this session, if it is used.
|
boolean |
isMessage(java.lang.String key)
Return true if a message string for the specified message key
is present for the user's Locale.
|
java.lang.String |
link(java.lang.String name)
Wrapper for getLink(String)
|
java.lang.String |
message(java.lang.String key)
Wrapper for getMessage(String)
|
java.lang.String |
message(java.lang.String key,
java.lang.Object[] args)
Wrapper for getMessage(String,Object[])
|
void |
setApplication(javax.servlet.ServletContext application)
Set the application associated with this instance.
|
void |
setForward(ActionForward forward)
Set the forward associated with this instance.
|
void |
setRequest(javax.servlet.http.HttpServletRequest request)
Set the request associated with this object.
|
void |
setResources(javax.servlet.ServletContext application,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Set the application and request for this object instance.
|
void |
setResponse(javax.servlet.http.HttpServletResponse response)
Set the response associated with this isntance.
|
void |
setSession(javax.servlet.http.HttpSession session)
Set the session associated with this instance.
|
private javax.servlet.ServletContext application
private javax.servlet.http.HttpSession session
private javax.servlet.http.HttpServletRequest request
private javax.servlet.http.HttpServletResponse response
private ActionForward forward
public ConfigHelper()
public ConfigHelper(javax.servlet.ServletContext application, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
public void setApplication(javax.servlet.ServletContext application)
public void setSession(javax.servlet.http.HttpSession session)
public void setRequest(javax.servlet.http.HttpServletRequest request)
public void setResponse(javax.servlet.http.HttpServletResponse response)
public void setForward(ActionForward forward)
public void setResources(javax.servlet.ServletContext application, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
application
- - The associated ServletContext.request
- - The associated HTTP request.response
- - The associated HTTP response.public javax.sql.DataSource getDataSource()
javax.sql.DataSource
),
if one is configured for this application.getDataSource
in interface ConfigHelperInterface
public ActionMessages getActionMessages()
ConfigHelperInterface
org.apache.struts.action.ActionFormBeans
collection
for this application.getActionMessages
in interface ConfigHelperInterface
public MessageResources getMessageResources()
getMessageResources
in interface ConfigHelperInterface
public java.lang.String getServletMapping()
/action/*
) or
extension mapped pattern ((*.do
)
used to determine our Action URIs in this application.getServletMapping
in interface ConfigHelperInterface
public java.lang.String getToken()
getToken
in interface ConfigHelperInterface
public java.lang.Throwable getException()
getException
in interface ConfigHelperInterface
public MultipartRequestWrapper getMultipartRequestWrapper()
getMultipartRequestWrapper
in interface ConfigHelperInterface
public ActionMapping getMapping()
org.apache.struts.ActionMapping
instance for this request.getMapping
in interface ConfigHelperInterface
public boolean isMessage(java.lang.String key)
isMessage
in interface ConfigHelperInterface
key
- Message keypublic ActionForm getActionForm()
getActionForm
in interface ConfigHelperInterface
public ActionFormBean getFormBean(java.lang.String name)
null
.getFormBean
in interface ConfigHelperInterface
name
- Logical name of the requested form bean definitionpublic ActionForward getActionForward(java.lang.String name)
null
.getActionForward
in interface ConfigHelperInterface
name
- Logical name of the requested forwardingpublic ActionMapping getActionMapping(java.lang.String path)
null
.getActionMapping
in interface ConfigHelperInterface
path
- Request path for which a mapping is requestedpublic java.lang.String getActionMappingName(java.lang.String action)
action
property is manipulated as follows in
computing the name of the requested mapping:
getActionMappingName
in interface ConfigHelperInterface
public java.lang.String getActionMappingURL(java.lang.String action)
getActionMappingURL
in interface ConfigHelperInterface
public java.lang.String getEncodeURL(java.lang.String url)
getEncodeURL
in interface ConfigHelperInterface
public java.lang.String getOrigRef()
getOrigRef
in interface ConfigHelperInterface
public java.lang.String getBaseRef()
getBaseRef
in interface ConfigHelperInterface
public java.lang.String getLink(java.lang.String name)
null
.getLink
in interface ConfigHelperInterface
name
- Name given to local or global forward.public java.lang.String getMessage(java.lang.String key)
null
.getMessage
in interface ConfigHelperInterface
key
- Message keypublic java.lang.String getMessage(java.lang.String key, java.lang.Object[] args)
getMessage
in interface ConfigHelperInterface
key
- Message key to be looked up and returnedargs
- Replacement parameters for this messagepublic java.lang.String getAction(java.lang.String path)
null
.getAction
in interface ConfigHelperInterface
path
- Name given to local or global forward.public java.lang.String link(java.lang.String name)
name
- Name given to local or global forward.public java.lang.String message(java.lang.String key)
key
- Message keypublic java.lang.String message(java.lang.String key, java.lang.Object[] args)
key
- Message key to be looked up and returnedargs
- Replacement parameters for this messagepublic java.lang.String action(java.lang.String path)
path
- Name given to local or global forward.Copyright ? 2000-2014 - The Apache Software Foundation