public class StrutsDelegate
extends java.lang.Object
| Modifier | Constructor and Description | 
|---|---|
| protected  | StrutsDelegate() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addError(org.apache.struts.action.ActionErrors errors,
        java.lang.String msgKey,
        java.lang.Object... params)Add a message to an existing set of ActionErrors. | 
| void | addError(java.lang.String msgKey,
        org.apache.struts.action.ActionErrors errors)Add a message to an existing set of ActionErrors. | 
| java.lang.String | extractString(org.apache.struts.upload.FormFile f)Util to get the String version of a file upload form. | 
| org.apache.struts.action.ActionForward | forwardParam(org.apache.struts.action.ActionForward base,
            java.lang.String param,
            java.lang.String value)Take an action forward and toss on a form variable. | 
| org.apache.struts.action.ActionForward | forwardParams(org.apache.struts.action.ActionForward base,
             java.util.Map params)Take an action forward and toss on a set of form variables. | 
| java.lang.String | getFormFileName(org.apache.struts.action.DynaActionForm form,
               java.lang.String paramName)Util to get the String file name of a file upload form. | 
| java.lang.String | getFormFileString(org.apache.struts.action.DynaActionForm form,
                 java.lang.String paramName)Util to get the String version of a file upload form. | 
| static StrutsDelegate | getInstance()Retuns an instance of the struts delegate factory | 
| java.lang.String | getTextAreaValue(org.apache.struts.action.DynaActionForm form,
                java.lang.String name)Use this for every textarea that we use in our UI. | 
| DatePicker | prepopulateDatePicker(javax.servlet.http.HttpServletRequest request,
                     org.apache.struts.action.DynaActionForm form,
                     java.lang.String name,
                     int yearDirection)Creates a date picker object with the given name and prepopulates the date
 with values from the given request's parameters. | 
| java.util.Date | readDatePicker(org.apache.struts.action.DynaActionForm form,
              java.lang.String name,
              int yearDirection)Reads the earliest date from a form populated by a datepicker. | 
| void | rememberDatePicker(java.util.Map requestParams,
                  org.apache.struts.action.DynaActionForm form,
                  java.lang.String name,
                  int yearDirection)Writes the values of a date picker form to the  requestParamsfor remembering form values across requests. | 
| void | saveMessage(java.lang.String msgKey,
           javax.servlet.http.HttpServletRequest req)Add a UI message to the Request. | 
| void | saveMessage(java.lang.String msgKey,
           java.lang.String[] params,
           javax.servlet.http.HttpServletRequest req)Add a UI message to the Request. | 
| void | saveMessages(javax.servlet.http.HttpServletRequest request,
            org.apache.struts.action.ActionMessages messages)Add messages to the request | 
| void | saveMessages(javax.servlet.http.HttpServletRequest request,
            java.util.List<ValidatorError> errors,
            java.util.List<ValidatorWarning> warnings)Add messages to the request | 
| void | saveMessages(javax.servlet.http.HttpServletRequest request,
            ValidatorResult result)Add messages to the request | 
public static StrutsDelegate getInstance()
public org.apache.struts.action.ActionForward forwardParam(org.apache.struts.action.ActionForward base,
                                                           java.lang.String param,
                                                           java.lang.String value)
base - Base ActionForwardparam - Parameter to be added to the ActionForward url.value - Value of parameter to be added.public org.apache.struts.action.ActionForward forwardParams(org.apache.struts.action.ActionForward base,
                                                            java.util.Map params)
base - Base ActionForwardparams - Parameters to be added to the ActionForward url.public void addError(java.lang.String msgKey,
                     org.apache.struts.action.ActionErrors errors)
msgKey - to adderrors - to add toopublic void addError(org.apache.struts.action.ActionErrors errors,
                     java.lang.String msgKey,
                     java.lang.Object... params)
errors - to add toomsgKey - to addparams - key paramspublic void saveMessage(java.lang.String msgKey,
                        javax.servlet.http.HttpServletRequest req)
msgKey - of the string you want to displayreq - used to store the message in.public void saveMessage(java.lang.String msgKey,
                        java.lang.String[] params,
                        javax.servlet.http.HttpServletRequest req)
msgKey - of the string you want to displayparams - formatted params for the localized messagereq - used to store the message in.public void saveMessages(javax.servlet.http.HttpServletRequest request,
                         org.apache.struts.action.ActionMessages messages)
request - Request where messages will be saved.messages - Messages to be saved.public void saveMessages(javax.servlet.http.HttpServletRequest request,
                         java.util.List<ValidatorError> errors,
                         java.util.List<ValidatorWarning> warnings)
request - Request where messages will be saved.errors - List of ValidatorError objects.warnings - List of ValidatorWarning objects.public void saveMessages(javax.servlet.http.HttpServletRequest request,
                         ValidatorResult result)
request - Request where messages will bed saved.result - the validator result object..public java.lang.String getFormFileName(org.apache.struts.action.DynaActionForm form,
                                        java.lang.String paramName)
form - to get the contents fromparamName - of the FormFilepublic java.lang.String getFormFileString(org.apache.struts.action.DynaActionForm form,
                                          java.lang.String paramName)
form - to get the contents fromparamName - of the FormFilepublic java.lang.String extractString(org.apache.struts.upload.FormFile f)
f - the  formfile to extract data off....public java.lang.String getTextAreaValue(org.apache.struts.action.DynaActionForm form,
                                         java.lang.String name)
form - to fetch fromname - of value in formpublic java.util.Date readDatePicker(org.apache.struts.action.DynaActionForm form,
                                     java.lang.String name,
                                     int yearDirection)
form - The datePickerFormname - The prefix for the date picker form fields, usually "date"yearDirection - One of DatePicker's year range static variables.DatePickerpublic void rememberDatePicker(java.util.Map requestParams,
                               org.apache.struts.action.DynaActionForm form,
                               java.lang.String name,
                               int yearDirection)
requestParams
 for remembering form values across requests.
 Your dyna action picker must either be a struts datePickerForm, or
 possess all of datePickerForm's fields.requestParams - The map to which to copy form fieldsform - The datePickerFormname - The prefix for the date picker form fields, usually "date"yearDirection - One of DatePicker's year range static variables.DatePickerpublic DatePicker prepopulateDatePicker(javax.servlet.http.HttpServletRequest request, org.apache.struts.action.DynaActionForm form, java.lang.String name, int yearDirection)
request - The request from which to get initial form field values.form - The datePickerFormname - The prefix for the date picker form fields, usually "date"yearDirection - One of DatePicker's year range static variables.DatePicker