Package org.bedework.util.struts
Class Request
- java.lang.Object
-
- org.bedework.util.servlet.ReqUtil
-
- org.bedework.util.struts.Request
-
- All Implemented Interfaces:
Serializable
public class Request extends ReqUtil
Class to handle the incoming request.- Author:
- Mike Douglass
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.struts.action.Actionactionprotected intactionTypestatic intactionTypeActionstatic StringactionTypeKeyaction mapping keys - note the "="static intactionTypeRenderstatic intactionTypeResourcestatic String[]actionTypesstatic intactionTypeUnknownstatic StringconversationKeyprotected intconversationTypestatic intconversationTypeContinuepart-way through a multi-request conversationstatic intconversationTypeEndend of a multi-request conversationstatic intconversationTypeOnlyif a conversation is started, end it on entry with no processing of changes.static intconversationTypeProcessAndOnlyIf a conversation is already started on entry, process changes and end it.static String[]conversationTypesstatic intconversationTypeStartstart of a multi-request conversationstatic intconversationTypeUnknownIn the absence of a conversation parameter we assume that a conversation starts with actionType=action and ends with actionType=render.protected UtilActionFormformprotected org.apache.struts.action.ActionMappingmappingprotected StringmoduleNameMay be specified as an action parameter or overriddem by the request parameter.static StringmoduleNameKeystatic StringmoduleNameParRequest parameter to specify which modulestatic StringrefreshActionKeystatic StringrefreshIntervalKeystatic StringrefreshIntervalReqPar
-
Constructor Summary
Constructors Constructor Description Request(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, UtilActionForm form, org.apache.struts.action.Action action, org.apache.struts.action.ActionMapping mapping)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.struts.action.ActiongetAction()StringgetActionParameter()StringgetActionPath()intgetActionType()intgetConversationType()MessageEmitgetErr()booleangetErrorsEmitted()UtilActionFormgetForm()IntegergetIntActionPar(String name)protected IntegergetIntActionPar(String name, String par)IntegergetIntReqPar(String name, String errProp)Get an Integer request parameter or null.org.apache.struts.action.ActionMappinggetMapping()StringgetModuleName()MessageEmitgetMsg()StringgetRefreshAction()IntegergetRefreshInt()StringgetStringActionPar(String name)StringgetStringActionPar(String name, String par)-
Methods inherited from class org.bedework.util.servlet.ReqUtil
getBooleanReqPar, getBooleanReqPar, getErrFlag, getIntReqPar, getIntReqPar, getLocales, getLongReqPar, getLongReqPar, getRemoteAddr, getRemoteHost, getRemotePort, getReqPar, getReqPar, getReqPars, getRequest, getRequestAttr, getResponse, getSessionAttr, notNull, present, removeSessionAttr, setErrFlag, setRequestAttr, setSessionAttr
-
-
-
-
Field Detail
-
form
protected UtilActionForm form
-
action
protected org.apache.struts.action.Action action
-
mapping
protected org.apache.struts.action.ActionMapping mapping
-
actionTypeUnknown
public static final int actionTypeUnknown
- See Also:
- Constant Field Values
-
actionTypeRender
public static final int actionTypeRender
- See Also:
- Constant Field Values
-
actionTypeAction
public static final int actionTypeAction
- See Also:
- Constant Field Values
-
actionTypeResource
public static final int actionTypeResource
- See Also:
- Constant Field Values
-
actionTypes
public static final String[] actionTypes
-
actionType
protected int actionType
-
refreshIntervalReqPar
public static final String refreshIntervalReqPar
- See Also:
- Constant Field Values
-
actionTypeKey
public static final String actionTypeKey
action mapping keys - note the "="- See Also:
- Constant Field Values
-
conversationKey
public static final String conversationKey
- See Also:
- Constant Field Values
-
refreshIntervalKey
public static final String refreshIntervalKey
- See Also:
- Constant Field Values
-
refreshActionKey
public static final String refreshActionKey
- See Also:
- Constant Field Values
-
moduleNameKey
public static final String moduleNameKey
- See Also:
- Constant Field Values
-
conversationTypeUnknown
public static final int conversationTypeUnknown
In the absence of a conversation parameter we assume that a conversation starts with actionType=action and ends with actionType=render. Conversations are related to the persistence framework and allow us to keep a persistence engine session running until the sequence of actions is completed.- See Also:
- Constant Field Values
-
conversationTypeStart
public static final int conversationTypeStart
start of a multi-request conversation- See Also:
- Constant Field Values
-
conversationTypeContinue
public static final int conversationTypeContinue
part-way through a multi-request conversation- See Also:
- Constant Field Values
-
conversationTypeEnd
public static final int conversationTypeEnd
end of a multi-request conversation- See Also:
- Constant Field Values
-
conversationTypeOnly
public static final int conversationTypeOnly
if a conversation is started, end it on entry with no processing of changes. Start a new conversation which we will end on exit.- See Also:
- Constant Field Values
-
conversationTypeProcessAndOnly
public static final int conversationTypeProcessAndOnly
If a conversation is already started on entry, process changes and end it. Start a new conversation which we will end on exit.- See Also:
- Constant Field Values
-
conversationTypes
public static final String[] conversationTypes
-
conversationType
protected int conversationType
-
moduleNamePar
public static final String moduleNamePar
Request parameter to specify which module- See Also:
- Constant Field Values
-
moduleName
protected String moduleName
May be specified as an action parameter or overriddem by the request parameter.
-
-
Constructor Detail
-
Request
public Request(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, UtilActionForm form, org.apache.struts.action.Action action, org.apache.struts.action.ActionMapping mapping)- Parameters:
request- the http requestresponse- the responseform- form objectaction- the actionsmapping- and the mapping
-
-
Method Detail
-
getForm
public UtilActionForm getForm()
- Returns:
- UtilActionForm
-
getAction
public org.apache.struts.action.Action getAction()
- Returns:
- Action
-
getMapping
public org.apache.struts.action.ActionMapping getMapping()
- Returns:
- ActionMapping
-
getErr
public MessageEmit getErr()
- Returns:
- MessageEmit
-
getMsg
public MessageEmit getMsg()
- Returns:
- MessageEmit
-
getErrorsEmitted
public boolean getErrorsEmitted()
- Returns:
- boolean
-
getActionType
public int getActionType()
- Returns:
- int
-
getActionPath
public String getActionPath()
- Returns:
- the part of the URL that identifies the action.
-
getActionParameter
public String getActionParameter()
- Returns:
- the action parameter if any.
-
getConversationType
public int getConversationType()
- Returns:
- int
-
getModuleName
public String getModuleName()
- Returns:
- String
-
getRefreshInt
public Integer getRefreshInt()
-
getRefreshAction
public String getRefreshAction()
-
getIntReqPar
public Integer getIntReqPar(String name, String errProp) throws Throwable
Get an Integer request parameter or null. Emit error for non-null and non integer- Parameters:
name- name of parametererrProp- error to emit- Returns:
- Integer value or null
- Throws:
Throwable- on error
-
getIntActionPar
public Integer getIntActionPar(String name)
- Parameters:
name- of parameter- Returns:
- value of given parameter or null
-
getStringActionPar
public String getStringActionPar(String name)
- Parameters:
name- of parameter- Returns:
- value of given parameter or null
-
-