Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.struts.config.ConfigHelper
Field Summary | |
private ServletContext |
|
private ActionForward |
|
private HttpServletRequest |
|
private HttpServletResponse |
|
private HttpSession |
|
Constructor Summary | |
|
Method Summary | |
String |
|
String |
|
String |
|
int |
|
int |
|
Iterator |
|
Iterator |
|
boolean |
|
String |
|
ActionErrors |
|
ActionForm | |
ActionFormBeans |
|
ActionForward |
|
ActionForwards |
|
ActionMapping |
|
String |
|
String |
|
ActionMappings |
|
ActionMessages |
|
String |
|
DataSource |
|
String |
|
String |
|
String |
|
int |
|
int |
|
Iterator |
|
Iterator |
|
boolean |
|
Throwable |
|
ActionFormBean |
|
String |
|
Locale |
|
ActionMapping |
|
String |
|
String |
|
MessageResources |
|
MultipartRequestWrapper |
|
String |
|
String |
|
String |
|
boolean |
|
String |
|
String |
|
String |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
private ServletContext application
The application associated with this instance.
private HttpServletRequest request
The request associated with this instance.
private HttpServletResponse response
The response associated with this instance.
private HttpSession session
The session associated with this instance.
public ConfigHelper()
public ConfigHelper(ServletContext application, HttpServletRequest request, HttpServletResponse response)
public String action(String path)
Wrapper for getAction(String)
- Parameters:
path
- Name given to local or global forward.
public String errorOutput()
Wrapper for getErrorMarkup()
public String errorOutput(String property)
Wrapper for getErrorMarkup(String)
public int errorSize()
Alias for getErrorSize()
public int errorSize(String property)
Wrapper for getErrorSize(String)
- Parameters:
property
- Property name
public Iterator errors()
Wrapper for getErrors()
public Iterator errors(String property)
Wrapper for getErrors(String)
public boolean errorsEmpty()
Wrapper for getErrorEmpty()
public String getAction(String path)
Return the URL for the specified ActionMapping, otherwise returnnull
.
- Specified by:
- getAction in interface ConfigHelperInterface
- Parameters:
path
- Name given to local or global forward.
public ActionErrors getActionErrors()
Theorg.apache.struts.action.ActionErrors
object, for this request.
- Specified by:
- getActionErrors in interface ConfigHelperInterface
public ActionForm getActionForm()
- Specified by:
- getActionForm in interface ConfigHelperInterface
public ActionFormBeans getActionFormBeans()
Theorg.apache.struts.action.ActionFormBeans
collection for this application.
- Specified by:
- getActionFormBeans in interface ConfigHelperInterface
public ActionForward getActionForward(String name)
Return the forwarding associated with the specified logical name, if any; otherwise returnnull
.
- Specified by:
- getActionForward in interface ConfigHelperInterface
- Parameters:
name
- Logical name of the requested forwarding
public ActionForwards getActionForwards()
Theorg.apache.struts.action.ActionForwards
collection for this application.
- Specified by:
- getActionForwards in interface ConfigHelperInterface
public ActionMapping getActionMapping(String path)
Return the mapping associated with the specified request path, if any; otherwise returnnull
.
- Specified by:
- getActionMapping in interface ConfigHelperInterface
- Parameters:
path
- Request path for which a mapping is requested
public String getActionMappingName(String action)
Return the form action converted into an action mapping path. The value of theaction
property is manipulated as follows in computing the name of the requested mapping:
- Any filename extension is removed (on the theory that extension mapping is being used to select the controller servlet).
- If the resulting value does not start with a slash, then a slash is prepended.
- Specified by:
- getActionMappingName in interface ConfigHelperInterface
public String getActionMappingURL(String action)
Return the form action converted into a server-relative URL.
- Specified by:
- getActionMappingURL in interface ConfigHelperInterface
public ActionMappings getActionMappings()
The context attributes key under which ourorg.apache.struts.action.ActionMappings
collection is normally stored, unless overridden when initializing our ActionServlet.
- Specified by:
- getActionMappings in interface ConfigHelperInterface
public ActionMessages getActionMessages()
Theorg.apache.struts.action.ActionFormBeans
collection for this application.
- Specified by:
- getActionMessages in interface ConfigHelperInterface
public String getBaseRef()
Renders the reference for a HTMLelement.
- Specified by:
- getBaseRef in interface ConfigHelperInterface
public DataSource getDataSource()
The strong>default configured data source (which must implementjavax.sql.DataSource
), if one is configured for this application.
- Specified by:
- getDataSource in interface ConfigHelperInterface
public String getEncodeURL(String url)
Return the url encoded to maintain the user session, if any.
- Specified by:
- getEncodeURL in interface ConfigHelperInterface
public String getErrorOutput()
Wrapper for getErrorMarkup(null)
- Specified by:
- getErrorOutput in interface ConfigHelperInterface
public String getErrorOutput(String property)
Returns the errors.header, any errors, and the errors.footer.
- Specified by:
- getErrorOutput in interface ConfigHelperInterface
- Parameters:
property
- Property name
public int getErrorSize()
Return the number of error messages.
- Specified by:
- getErrorSize in interface ConfigHelperInterface
public int getErrorSize(String property)
Return the number of error messages.
- Specified by:
- getErrorSize in interface ConfigHelperInterface
- Parameters:
property
- Property name
public Iterator getErrors()
Return the error messages
- Specified by:
- getErrors in interface ConfigHelperInterface
public Iterator getErrors(String property)
Return an ActionError for a property
- Specified by:
- getErrors in interface ConfigHelperInterface
- Parameters:
property
- Property name
public boolean getErrorsEmpty()
Return true if there are no errors queued
- Specified by:
- getErrorsEmpty in interface ConfigHelperInterface
public Throwable getException()
The runtime JspException that may be been thrown by a Struts tag extension, or compatible presentation extension, and placed in the request.
- Specified by:
- getException in interface ConfigHelperInterface
public ActionFormBean getFormBean(String name)
Return the form bean definition associated with the specified logical name, if any; otherwise returnnull
.
- Specified by:
- getFormBean in interface ConfigHelperInterface
- Parameters:
name
- Logical name of the requested form bean definition
public String getLink(String name)
Return the path for the specified forward, otherwise returnnull
.
- Specified by:
- getLink in interface ConfigHelperInterface
- Parameters:
name
- Name given to local or global forward.
public Locale getLocale()
Thejava.util.Locale
for the user, if any. If a default locale object is not in the user's session, the system default locale is returned. If used, the user locale is typically set during login processing under the keyGlobals.LOCALE_KEY
.
- Specified by:
- getLocale in interface ConfigHelperInterface
public ActionMapping getMapping()
Theorg.apache.struts.ActionMapping
instance for this request.
- Specified by:
- getMapping in interface ConfigHelperInterface
public String getMessage(String key)
Return the localized message for the specified key, otherwise returnnull
.
- Specified by:
- getMessage in interface ConfigHelperInterface
- Parameters:
key
- Message key
public String getMessage(String key, args[] )
Look up and return a message string, based on the specified parameters.
- Specified by:
- getMessage in interface ConfigHelperInterface
- Parameters:
key
- Message key to be looked up and returned
public MessageResources getMessageResources()
The application resources for this application.
- Specified by:
- getMessageResources in interface ConfigHelperInterface
public MultipartRequestWrapper getMultipartRequestWrapper()
The multipart object for this request.
- Specified by:
- getMultipartRequestWrapper in interface ConfigHelperInterface
public String getOrigRef()
Renders the reference for a HTMLelement
- Specified by:
- getOrigRef in interface ConfigHelperInterface
public String getServletMapping()
The path-mapped pattern (/action/*
) or extension mapped pattern ((*.do
) used to determine our Action URIs in this application.
- Specified by:
- getServletMapping in interface ConfigHelperInterface
public String getToken()
The transaction token stored in this session, if it is used.
- Specified by:
- getToken in interface ConfigHelperInterface
public boolean isMessage(String key)
Return true if a message string for the specified message key is present for the user's Locale.
- Specified by:
- isMessage in interface ConfigHelperInterface
- Parameters:
key
- Message key
public String link(String name)
Wrapper for getLink(String)
- Parameters:
name
- Name given to local or global forward.
public String message(String key)
Wrapper for getMessage(String)
- Parameters:
key
- Message key
public String message(String key, args[] )
Wrapper for getMessage(String,Object[])
- Parameters:
key
- Message key to be looked up and returned
public void setApplication(ServletContext application)
Set the application associated with this instance. [servlet.getServletContext()]
public void setForward(ActionForward forward)
Set the forward associated with this instance.
public void setRequest(HttpServletRequest request)
Set the request associated with this object. Session object is also set or cleared.
public void setResources(ServletContext application, HttpServletRequest request, HttpServletResponse response)
Set the application and request for this object instance. The ServletContext can be set by any servlet in the application. The request should be the instant request. Most of the other methods retrieve their own objects by reference to the application, request, or session attributes. Do not call other methods without setting these first! This is also called by the convenience constructor.
- Parameters:
application
- - The associated ServletContext.request
- - The associated HTTP request.response
- - The associated HTTP response.
public void setResponse(HttpServletResponse response)
Set the response associated with this isntance. Session object is also set or cleared.
public void setSession(HttpSession session)
Set the session associated with this instance.