Package ru.bgcrm.struts.form
Class DynActionForm
java.lang.Object
org.apache.struts.action.ActionForm
ru.bgcrm.struts.form.DynActionForm
- All Implemented Interfaces:
Serializable
,org.apache.commons.beanutils.DynaBean
,org.apache.commons.beanutils.DynaClass
public class DynActionForm
extends org.apache.struts.action.ActionForm
implements org.apache.commons.beanutils.DynaBean, org.apache.commons.beanutils.DynaClass
HTTP request execution's context, contains: request, DB connection and response data.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static DynActionForm
Deprecated.static DynActionForm
System action, not real user request.Fields inherited from class org.apache.struts.action.ActionForm
multipartRequestHandler, servlet
-
Constructor Summary
ConstructorDescriptionEmpty constructor for Struts.DynActionForm
(String url) Constructor from string URL or only query string.DynActionForm
(User user) -
Method Summary
Modifier and TypeMethodDescriptionaction
(Class<? extends BaseAction> clazz) Buildsaction
as semicolon separated action ID and method name fromgetMethod()
boolean
Deprecated.Area ID is used ininvalid reference
BaseAction#restoreRequestParams()
org.apache.commons.beanutils.DynaClass
org.apache.commons.beanutils.DynaProperty[]
org.apache.commons.beanutils.DynaProperty
getDynaProperty
(String name) org.apache.struts.upload.FormFile
getFile()
Deprecated.javax.servlet.http.HttpServletRequest
Deprecated.javax.servlet.http.HttpServletResponse
int
getId()
getName()
getPage()
getParam()
Gets HTTP request parameter first value.Gets HTTP request parameter first value.Gets HTTP request parameter value.boolean
getParamBoolean
(String name) getParamBoolean
(String name, Boolean defaultValue) getParamDate
(String name) getParamDate
(String name, Date defaultValue) getParamDate
(String name, Date defaultValue, boolean defaultSet) Gets HTTP request parameter first value as type date, formatTimeUtils.FORMAT_TYPE_YMD
.getParamDateTime
(String name) getParamDateTime
(String name, Date defaultValue) getParamDateTime
(String name, Predicate<Date> validator) Gets HTTP request parameter first value as typeDate
.int
getParamInt
(String name) int
getParamInt
(String name, int defaultValue) int
getParamInt
(String name, Predicate<Integer> validator) Gets HTTP request parameter first value as typeint
.long
getParamLong
(String name) long
getParamLong
(String name, long defaultValue) getParamValues
(String name) Gets HTTP request parameter values as type int.getParamValuesList
(String name) Gets HTTP request parameter values as an ordered list of type int.getParamValuesListStr
(String name) Gets HTTP request parameter values as an ordered list.getParamValuesListStr
(String name, String exclude) Gets HTTP request parameter values as an ordered list.getParamValuesStr
(String name) Gets HTTP request parameter values.getParamYearMonth
(String name, Predicate<YearMonth> validator) Gets HTTP request parameter first value as typeYearMonth
.getUser()
int
org.apache.commons.beanutils.DynaBean
void
void
requestUrl
(String path, String queryString) Sets request parameterrequestUrl
.void
void
void
void
setConnectionSet
(ConnectionSet value) void
setForwardFile
(String value) Deprecated.void
setHttpRequest
(javax.servlet.http.HttpServletRequest httpRequest) void
setHttpResponse
(javax.servlet.http.HttpServletResponse httpResponse) void
Sets HTTPS request parameter value.void
setPermission
(ConfigMap permission) void
setRequestAttribute
(String key, Object value) Set HTTP request attribute.void
setRequestUrl
(String value) void
setResponseData
(String key, Object value) Set response object data.void
setResponseType
(String value) Sets request parameterresponseType
void
setReturnChildUiid
(String value) Deprecated.void
setReturnUrl
(String value) Deprecated.void
Methods inherited from class org.apache.struts.action.ActionForm
getMultipartRequestHandler, getServlet, getServletWrapper, reset, reset, setMultipartRequestHandler, setServlet, validate, validate
-
Field Details
-
KEY
- See Also:
-
RESPONSE_TYPE_HTML
- See Also:
-
RESPONSE_TYPE_JSON
- See Also:
-
RESPONSE_TYPE_STREAM
- See Also:
-
SYSTEM_FORM
System action, not real user request. -
SERVER_FORM
Deprecated. -
PARAM_ACTION_METHOD
- See Also:
-
PARAM_ACTION_METHOD_OLD
- See Also:
-
l
-
-
Constructor Details
-
DynActionForm
public DynActionForm()Empty constructor for Struts. -
DynActionForm
-
DynActionForm
Constructor from string URL or only query string.- Parameters:
url
- the complete URL or only the query string after?
.
-
-
Method Details
-
paramsToQueryString
- Returns:
- request params except
PARAM_REQUEST_URL
, serialized to a query string.
-
getHttpRequest
public javax.servlet.http.HttpServletRequest getHttpRequest() -
setHttpRequest
public void setHttpRequest(javax.servlet.http.HttpServletRequest httpRequest) -
getRequestURI
- Returns:
- http request path without query string
-
getHttpRequestURI
Deprecated.Useinvalid reference
#getRequestPath()
-
getHttpResponse
public javax.servlet.http.HttpServletResponse getHttpResponse() -
setHttpResponse
public void setHttpResponse(javax.servlet.http.HttpServletResponse httpResponse) -
getHttpResponseOutputStream
- Throws:
IOException
-
getHttpResponseWriter
- Throws:
IOException
-
getPage
-
getFile
public org.apache.struts.upload.FormFile getFile() -
getParam
- Returns:
- request parameters
-
getMethod
- Returns:
- request parameter
method
, action class method name
-
getAction
Deprecated.UsegetMethod()
- Returns:
- request parameter
action
, action class method name
-
action
Buildsaction
as semicolon separated action ID and method name fromgetMethod()
- Parameters:
clazz
- the action class- Returns:
- the generated value
-
getId
public int getId()- Returns:
- request parameter
id
-
getRequestUrl
- Returns:
- request parameter
requestUrl
-
setRequestUrl
-
requestUrl
Sets request parameterrequestUrl
.- Parameters:
path
- start ofrequestUrl
.queryString
- query string, if not blank then added to end after query char.
-
getResponseType
- Returns:
- request parameter
responseType
-
setResponseType
Sets request parameterresponseType
- Parameters:
value
- the value
-
getReturnUrl
- Returns:
- request parameter
returnUrl
, URL for returning back from an editor
-
setReturnUrl
Deprecated.Used in mobile interface<c:set target="${form}" property="returnUrl" value="${reopenProcessUrl}"/>
-
getReturnChildUiid
- Returns:
- request parameter
returnChildUiid
, HTML element ID, for the parent of that has to be placed result of loadinggetReturnUrl()
-
setReturnChildUiid
Deprecated.Used in mobile interface<c:set target="${form}" property="returnChildUiid" value="${uiid}"/>
-
getForwardFile
Deprecated.- Returns:
- request parameter
forwardFile
, JSP template path
-
setForwardFile
Deprecated.Sets request parameterforwardFile
, JSP template path- Parameters:
value
-
-
getPageableId
- Returns:
- request parameter
pageableId
oraction
if it was empty or missing.
-
getAreaId
Area ID is used ininvalid reference
BaseAction#restoreRequestParams()
- Returns:
- request parameter
areaId
oraction
if it was empty or missing.
-
getParam
public String getParam(String name, String defaultValue, boolean defaultSet, Predicate<String> validator) throws BGIllegalArgumentException Gets HTTP request parameter value.- Parameters:
name
- parameter name.defaultValue
- default value if not presented in request.defaultSet
- set default value back in request for using in JSP.validator
- optional value validator.- Returns:
- Throws:
BGIllegalArgumentException
- if validation fails.
-
getParam
public String getParam(String name, String defaultValue, Predicate<String> validator) throws BGIllegalArgumentException - Throws:
BGIllegalArgumentException
-
getParam
Gets HTTP request parameter first value.- Parameters:
name
- the parameter's name.defaultValue
- default value.- Returns:
- the value of parameter with or if not presented.
-
getParam
- Throws:
BGIllegalArgumentException
-
getParam
Gets HTTP request parameter first value.- Parameters:
name
- the parameter's name.- Returns:
- parameter value or null if missing or empty.
-
setParam
Sets HTTPS request parameter value.- Parameters:
name
- the parameter's name.value
- the value.
-
getParamDate
Gets HTTP request parameter first value as type date, formatTimeUtils.FORMAT_TYPE_YMD
.- Parameters:
name
- parameter name.defaultValue
- default value if not presented in request.defaultSet
- set default value back in request for using in JSP.- Returns:
-
getParamDate
-
getParamDate
-
getParamYearMonth
public YearMonth getParamYearMonth(String name, Predicate<YearMonth> validator) throws BGIllegalArgumentException Gets HTTP request parameter first value as typeYearMonth
.- Parameters:
name
- parameter name, storing the first day of month in string formatTimeUtils.FORMAT_TYPE_YMD
.validator
- optional value validator.- Returns:
- parameter value or
null
. - Throws:
BGIllegalArgumentException
- when validation fails.
-
getParamDateTime
-
getParamDateTime
-
getParamDateTime
public Date getParamDateTime(String name, Predicate<Date> validator) throws BGIllegalArgumentException Gets HTTP request parameter first value as typeDate
.- Parameters:
name
- parameter name, storing the first day of month in string formatTimeUtils.FORMAT_TYPE_YMDHMS
.validator
- optional value validator.- Returns:
- parameter value or
null
. - Throws:
BGIllegalArgumentException
- when validation fails.
-
getParamInt
-
getParamInt
-
getParamInt
Gets HTTP request parameter first value as typeint
.- Parameters:
name
- parameter name.validator
- optional value validator.- Returns:
- parsed int value or
0
. - Throws:
BGIllegalArgumentException
-
getParamLong
-
getParamLong
-
getParamBoolean
-
getParamBoolean
-
getParamValues
Gets HTTP request parameter values as type int.- Parameters:
name
- the parameter name.- Returns:
- not
null
set with all the parameter values parsed to integer.
-
getParamValuesStr
Gets HTTP request parameter values.- Parameters:
name
- the parameter name.- Returns:
- not
null
set with all the parameter values excluding empty strings.
-
getParamValuesList
Gets HTTP request parameter values as an ordered list of type int.- Parameters:
name
- the parameter name.- Returns:
- not
null
list with all the parameter values parsed to integer.
-
getParamValuesListStr
Gets HTTP request parameter values as an ordered list.- Parameters:
name
- the parameter name.- Returns:
- not
null
list with all the parameter values.
-
getParamValuesListStr
Gets HTTP request parameter values as an ordered list.- Parameters:
name
- the parameter name.exclude
- excluded value.- Returns:
- not
null
list with all the parameter values.
-
getConnectionSet
-
setConnectionSet
-
getUser
-
setUser
-
getUserId
public int getUserId() -
getPermission
-
setPermission
-
getResponse
-
setResponseData
Set response object data.- Parameters:
key
-value
-
-
setRequestAttribute
Set HTTP request attribute. Unlike response data, not serialized to JSON.- Parameters:
key
-value
-
-
get
- Specified by:
get
in interfaceorg.apache.commons.beanutils.DynaBean
-
set
- Specified by:
set
in interfaceorg.apache.commons.beanutils.DynaBean
-
contains
- Specified by:
contains
in interfaceorg.apache.commons.beanutils.DynaBean
-
get
- Specified by:
get
in interfaceorg.apache.commons.beanutils.DynaBean
-
get
- Specified by:
get
in interfaceorg.apache.commons.beanutils.DynaBean
-
getDynaClass
public org.apache.commons.beanutils.DynaClass getDynaClass()- Specified by:
getDynaClass
in interfaceorg.apache.commons.beanutils.DynaBean
-
remove
- Specified by:
remove
in interfaceorg.apache.commons.beanutils.DynaBean
-
set
- Specified by:
set
in interfaceorg.apache.commons.beanutils.DynaBean
-
set
- Specified by:
set
in interfaceorg.apache.commons.beanutils.DynaBean
-
getName
- Specified by:
getName
in interfaceorg.apache.commons.beanutils.DynaClass
-
getDynaProperty
- Specified by:
getDynaProperty
in interfaceorg.apache.commons.beanutils.DynaClass
-
getDynaProperties
public org.apache.commons.beanutils.DynaProperty[] getDynaProperties()- Specified by:
getDynaProperties
in interfaceorg.apache.commons.beanutils.DynaClass
-
newInstance
public org.apache.commons.beanutils.DynaBean newInstance() throws IllegalAccessException, InstantiationException- Specified by:
newInstance
in interfaceorg.apache.commons.beanutils.DynaClass
- Throws:
IllegalAccessException
InstantiationException
-