|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.core.controller.ControllerRequest
com.jcorporate.expresso.core.controller.ServletControllerRequest
ServletControllerRequest is an extension of ControllerRequest that also contains access to "special" servlet-related items, such as the ServletResponse object. It should only be used *when absolutely necessary*, as normally a standard ControllerParms object is better.
| Constructor Summary | |
ServletControllerRequest()
Default constructor |
|
| Method Summary | |
Object |
clone()
Method that returns a copy of itself with all the fields properly filled out. |
Servlet |
getCallingServlet()
Gets the calling servlet. |
org.apache.struts.action.ActionForm |
getForm()
Gets the action form as a convenience for pure Struts writer. |
HttpServletRequest |
getHttpServletRequest()
Gets the http servlet response object Important: A Controller should only use this method if strictly necessary, and not write output that is otherwise able to be handled with inputs, outputs and transitions. |
HttpServletResponse |
getHttpServletResponse()
Gets the http servlet response object Important: A Controller should only use this method if strictly necessary, and not write output that is otherwise able to be handled with inputs, outputs and transitions. |
Locale |
getLocale()
Returns the locale of this request. |
org.apache.struts.action.ActionMapping |
getMapping()
Gets the action mapping as a convenience for pure Struts writer. |
String[] |
getParamValues(String paramName)
Fetches array of parameter values from underlying HTTP request; use this in a web app to access the underlying parameters in the HTTP request which have the same name; parameters with the same name are not reflected in the hashtable of params maintained by ControllerRequest; |
ServletRequest |
getServletRequest()
Gets the servlet request object Important: A Controller should only use this method if strictly necessary, and not write output that is otherwise able to be handled with inputs, outputs and transitions. |
ServletResponse |
getServletResponse()
Gets the servlet response object Important: A Controller should only use this method if strictly necessary, and not write output that is otherwise able to be handled with inputs, outputs and transitions. |
static ServletControllerRequest |
parseParams(org.apache.struts.action.ActionMapping mapping,
org.apache.struts.action.ActionForm form,
HttpServletRequest request,
HttpServletResponse response,
Controller controller)
Parse a regular servlet request for parameters (e.g. not multipart) |
static ServletControllerRequest |
parseParamsMultiPart(org.apache.struts.upload.MultipartRequestHandler mp,
org.apache.struts.action.ActionMapping mapping,
org.apache.struts.action.ActionForm form,
HttpServletRequest request,
HttpServletResponse response,
Controller controller)
Static constructor for creating an servlet controller request with all the acoutrements of the Struts Action execution signature. |
void |
setCallingServlet(Servlet newServlet)
Sets the calling servlet. |
void |
setForm(org.apache.struts.action.ActionForm newForm)
Sets the action form as a convenience for pure Struts writer. |
void |
setMapping(org.apache.struts.action.ActionMapping newMapping)
Sets the action mapping as a convenience for pure Struts writer author Peter Pilgrim |
void |
setServletRequest(ServletRequest newRequest)
Sets the servlet request object |
void |
setServletResponse(ServletResponse newResponse)
Sets the servlet response object |
| Methods inherited from class com.jcorporate.expresso.core.controller.ControllerRequest |
getAttrib, getAttribute, getAttributes, getDataContext, getDBName, getErrorCollection, getFileName, getFormAttribute, getInitParameter, getObjectParameter, getParameter, getParameters, getSession, getUid, getUser, getUserInfo, isFileParameter, isParameter, populate, removeAttrib, removeParameter, setAttrib, setAttribute, setAttributes, setDataContext, setDBName, setFileParameter, setFormAttribute, setInitParameter, setLocale, setObjectParameter, setParameter, setParameters, setSession, setUid, setUser, validateDBField, validateDBObject, validateField |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ServletControllerRequest()
| Method Detail |
public void setServletResponse(ServletResponse newResponse)
newResponse - the new servlet responsegetServletResponse()public void setServletRequest(ServletRequest newRequest)
newRequest - the new servlet requestgetServletRequest()public void setCallingServlet(Servlet newServlet)
newServlet - the new calling servletgetCallingServlet()public Servlet getCallingServlet()
getCallingServlet()public void setMapping(org.apache.struts.action.ActionMapping newMapping)
author Peter Pilgrim
newMapping - the ActionMapping associated with the controller requestgetMapping()public org.apache.struts.action.ActionMapping getMapping()
Controller object stores the current
action mapping instance in the ControllerResponse
using this method. Writers who only ever intend there
controller to be used in a web environment can access the
action mapping to do more sophisticated processing.
public AcmeController extends DBController {
protected void runProcessOrderState(
ControllerRequest req,
ControllerRequest res )
{
ServletControllerRequest request =
(ServletControllerRequest)req;
ActionMapping mapping = request.getMapping();
}
...
}
author Peter Pilgrim
setMapping(org.apache.struts.action.ActionMapping)public void setForm(org.apache.struts.action.ActionForm newForm)
newForm - the ActionForm associated with the controller requestgetForm()public org.apache.struts.action.ActionForm getForm()
Controller object stores the current
action form instance in the ControllerResponse
using this method. Writers who only ever intend there
controller to be used in a web environment can access the
action form to do more sophisticated processing.
public AcmeController extends DBController {
protected void runProcessOrderState(
ControllerRequest req,
ControllerRequest res )
{
ServletControllerRequest request =
(ServletControllerRequest)req;
ActionForm form = request.getForm();
}
...
}
author Peter Pilgrim
setForm(org.apache.struts.action.ActionForm)public ServletRequest getServletRequest()
getServletResponse(),
setServletRequest(javax.servlet.ServletRequest)public ServletResponse getServletResponse()
getServletRequest(),
setServletResponse(javax.servlet.ServletResponse)public HttpServletRequest getHttpServletRequest()
ClassCastException - if the servlet request cannot be
convert to HttpServletResponsegetHttpServletResponse()public HttpServletResponse getHttpServletResponse()
ClassCastException - if the servlet request cannot be
convert to HttpServletResponsegetHttpServletRequest()
public static ServletControllerRequest parseParamsMultiPart(org.apache.struts.upload.MultipartRequestHandler mp,
org.apache.struts.action.ActionMapping mapping,
org.apache.struts.action.ActionForm form,
HttpServletRequest request,
HttpServletResponse response,
Controller controller)
throws ServletException,
ControllerException
ActionMapping, ActionForm beans
as conveniences for Struts developers. You can probably sense I am cheesed off like
Simon Cowell int American (Pop) Idol
Docu byte Peter Pilgrim Fri Jan 23 23:20:41 GMT 2004
mapping - The ActionMapping used to select this instanceform - The optional ActionForm bean for this request (if any)request - the Servlet Requestresponse - the Servlet Responsecontroller - the Controller
ControllerException - exception upon controller error
ServletException - upon javax.servlet related errors
public static ServletControllerRequest parseParams(org.apache.struts.action.ActionMapping mapping,
org.apache.struts.action.ActionForm form,
HttpServletRequest request,
HttpServletResponse response,
Controller controller)
throws ServletException,
ControllerException
mapping - The ActionMapping used to select this instanceform - The optional ActionForm bean for this request (if any)request - the Servlet Requestresponse - the Servlet Responsecontroller - the Controller
ControllerException - exception upon controller error
ServletException - upon javax.servlet related errorspublic Locale getLocale()
ControllerRequest
getLocale in interface RequestContextgetLocale in class ControllerRequestpublic Object clone()
clone in class ControllerRequestpublic String[] getParamValues(String paramName)
paramName - key to look for among all parameters
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||