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
- Direct Known Subclasses:
BillingActionForm
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 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 TypeMethodDescriptionactionIdentifier
(Class<? extends BaseAction> clazz) BuildsactionIdentifier
as semicolon separated action class and method name fromgetAction()
.boolean
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()
Возвращает параметр запроса forward.Возвращает параметр запроса forwardFile.javax.servlet.http.HttpServletRequest
CallsgetHttpRequestRemoteAddr(HttpServletRequest)
forhttpRequest
.static String
getHttpRequestRemoteAddr
(javax.servlet.http.HttpServletRequest httpRequest) Gets IP address of request from HTTP header 'X-Real-IP' or another defined in configuration paramAccessLogValve.PARAM_HEADER_NAME_REMOTE_ADDR
orServletRequest.getRemoteAddr()
javax.servlet.http.HttpServletResponse
int
getId()
Возвращает параметр запроса id.getName()
getPage()
getParam()
Возвращает доступ к мапу параметров, для получения в JSP.Gets HTTP request parameter first value.Gets HTTP request parameter first value.Gets HTTP request parameter value.String[]
getParamArray
(String name) Возвращает значения параметров HTTP запроса.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
.Возвращает параметр запроса requestUrl.Возвращает параметр запроса responseType.Возвращает id HTML элемента на предка которого нужно загрузить returnUrl для возвращения из редактора.Возвращает id HTML элемента на который нужно загрузить returnUrl для возвращения из редактора.Возвращает URL, который нужно загрузить для возвращения из редактора.getSelectedValues
(String name) Deprecated.getSelectedValuesList
(String name) Deprecated.Deprecated.getSelectedValuesStr
(String name) Deprecated.getUser()
int
org.apache.commons.beanutils.DynaBean
void
void
requestUrl
(String requestURI, String queryString) Sets request parameterrequestUrl
.void
void
void
void
setConnectionSet
(ConnectionSet value) void
setFile
(org.apache.struts.upload.FormFile file) void
setForward
(String 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
setParam
(ArrayHashMap param) void
setParamArray
(String name, String[] values) Устанавливает значения параметров HTTP запроса.void
setParamArray
(String name, Collection<?> values) void
setPermission
(ConfigMap permission) void
setRequestAttribute
(String key, Object value) Set HTTP request attribute.void
setRequestUrl
(String requestUrl) void
setResponseData
(String key, Object value) Set response object data.void
setResponseType
(String responseType) Устанавливает параметр запроса responseType.void
setReturnChildUiid
(String value) void
setReturnUrl
(String returnUrl) 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. -
l
-
-
Constructor Details
-
DynActionForm
public DynActionForm()Empty constructor for Struts. -
DynActionForm
Constructor from string URL or only query string.- Parameters:
url
- the complete URL or only the query string after?
.
-
DynActionForm
-
-
Method Details
-
paramsToQueryString
- Returns:
- request params except
PARAM_REQUEST_URL
, serialized to a query string.
-
getHttpRequest
public javax.servlet.http.HttpServletRequest getHttpRequest() -
getHttpRequestURI
- Returns:
- request URI using method
ServletUtils.getRequestURI(HttpServletRequest)
with parameterhttpRequest
.
-
getHttpRequestRemoteAddr
CallsgetHttpRequestRemoteAddr(HttpServletRequest)
forhttpRequest
.- Returns:
-
getHttpRequestRemoteAddr
Gets IP address of request from HTTP header 'X-Real-IP' or another defined in configuration paramAccessLogValve.PARAM_HEADER_NAME_REMOTE_ADDR
orServletRequest.getRemoteAddr()
- Returns:
-
setHttpRequest
public void setHttpRequest(javax.servlet.http.HttpServletRequest httpRequest) -
getHttpResponse
public javax.servlet.http.HttpServletResponse getHttpResponse() -
setHttpResponse
public void setHttpResponse(javax.servlet.http.HttpServletResponse httpResponse) -
getHttpResponseOutputStream
- Throws:
IOException
-
getHttpResponseWriter
- Throws:
IOException
-
getConnectionSet
-
setConnectionSet
-
getResponse
-
setResponseData
Set response object data.- Parameters:
key
-value
-
-
setRequestAttribute
Set HTTP request attribute. Unlike response data, not serialized to JSON.- Parameters:
key
-value
-
-
getUser
-
setUser
-
getUserId
public int getUserId() -
getPermission
-
setPermission
-
getPage
-
getFile
public org.apache.struts.upload.FormFile getFile() -
setFile
public void setFile(org.apache.struts.upload.FormFile file) -
getParam
Возвращает доступ к мапу параметров, для получения в JSP.- Returns:
-
setParam
-
getAction
- Returns:
- request parameter
action
, action class method name.
-
getActionIdentifier
- Returns:
- current value of
actionIdentifier
.
-
actionIdentifier
BuildsactionIdentifier
as semicolon separated action class and method name fromgetAction()
.- Parameters:
clazz
- action class.- Returns:
- the generated value.
-
getId
public int getId()Возвращает параметр запроса id.- Returns:
-
getResponseType
Возвращает параметр запроса responseType.- Returns:
-
setResponseType
Устанавливает параметр запроса responseType.- Parameters:
responseType
-
-
getForward
Возвращает параметр запроса forward.- Returns:
-
setForward
-
getForwardFile
Возвращает параметр запроса forwardFile.- Returns:
-
setForwardFile
Deprecated.Return JSP template directly.- Parameters:
value
-
-
getRequestUrl
Возвращает параметр запроса requestUrl.- Returns:
-
setRequestUrl
-
requestUrl
Sets request parameterrequestUrl
.- Parameters:
requestURI
- start ofrequestUrl
.queryString
- query string, if not blank then added to end after query char.
-
getReturnUrl
Возвращает URL, который нужно загрузить для возвращения из редактора.- Returns:
-
setReturnUrl
-
getReturnUiid
Возвращает id HTML элемента на который нужно загрузить returnUrl для возвращения из редактора.- Returns:
-
getReturnChildUiid
Возвращает id HTML элемента на предка которого нужно загрузить returnUrl для возвращения из редактора.- Returns:
-
setReturnChildUiid
-
getPageableId
- Returns:
- request parameter
pageableId
oractionIdentifier
if it was empty or missing.
-
getAreaId
Area ID is used ininvalid reference
BaseAction#restoreRequestParams()
- Returns:
- request parameter
areaId
oractionIdentifier
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
-
getParamArray
Возвращает значения параметров HTTP запроса.- Parameters:
name
- имя параметра.- Returns:
- null, если параметр не установлен.
-
setParamArray
Устанавливает значения параметров HTTP запроса.- Parameters:
name
- имя параметра.values
- значения.
-
setParamArray
-
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.
-
getSelectedValues
Deprecated. -
getSelectedValuesStr
Deprecated. -
getSelectedValuesList
Deprecated. -
getSelectedValuesListStr
Deprecated. -
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
-