| java.lang.Object com.jcorporate.expresso.core.controller.ControllerRequest com.jcorporate.expresso.core.controller.ServletControllerRequest
ServletControllerRequest | public class ServletControllerRequest extends ControllerRequest implements Cloneable(Code) | | 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.
|
Method Summary | |
public Object | clone() Method that returns a copy of itself with all the fields properly filled
out. | public Servlet | getCallingServlet() Gets the calling servlet. | public synchronized ActionForm | getForm() Gets the action form as a convenience for pure Struts writer.
The base Controller object stores the current
action form instance in the ControllerResponse
using this method. | public 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. | public 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. | public Locale | getLocale() | public synchronized ActionMapping | getMapping() Gets the action mapping as a convenience for pure Struts writer.
The base Controller object stores the current
action mapping instance in the ControllerResponse
using this method. | public String[] | getParamValues(String paramName) | public 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. | public 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. | public static ServletControllerRequest | parseParams(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, Controller controller) Parse a regular servlet request for parameters (e.g. | public static ServletControllerRequest | parseParamsMultiPart(MultipartRequestHandler mp, ActionMapping mapping, 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.
I deliberate add the ActionMapping , ActionForm beans
as conveniences for Struts developers. | public void | setCallingServlet(Servlet newServlet) Sets the calling servlet. | public synchronized void | setForm(ActionForm newForm) Sets the action form as a convenience for pure Struts writer. | public synchronized void | setMapping(ActionMapping newMapping) | public synchronized void | setServletRequest(ServletRequest newRequest) | public synchronized void | setServletResponse(ServletResponse newResponse) |
ServletControllerRequest | public ServletControllerRequest()(Code) | | Default constructor
|
clone | public Object clone()(Code) | | Method that returns a copy of itself with all the fields properly filled
out. Note that all the servletrequest/servletresponse classes are merely
shallow copied since a deep copy is meaningless in a servlet environment
a new instantiated ServletControllerRequest object |
getForm | public synchronized ActionForm getForm()(Code) | | Gets the action form as a convenience for pure Struts writer.
The base 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
ActionForm See Also: ServletControllerRequest.setForm |
getHttpServletRequest | public HttpServletRequest getHttpServletRequest()(Code) | | 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.
If you do access the response object, you must also call setCustomOutput(true) in the
ControllResponse object to let the Controller container (ControllerServlet, ControllRun, etc)
know that it should not attempt to handle view processing itself.
Don't use it if you don't *need* it.
HttpServletRequest object throws: ClassCastException - if the servlet request cannot beconvert to HttpServletResponse See Also: ServletControllerRequest.getHttpServletResponse |
getHttpServletResponse | public HttpServletResponse getHttpServletResponse()(Code) | | 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.
If you do access the response object, you must also call setCustomOutput(true) in the
ControllResponse object to let the Controller container (ControllerServlet, ControllRun, etc)
know that it should not attempt to handle view processing itself.
Don't use it if you don't *need* it.
HttpServletResponse object throws: ClassCastException - if the servlet request cannot beconvert to HttpServletResponse See Also: ServletControllerRequest.getHttpServletRequest |
getMapping | public synchronized ActionMapping getMapping()(Code) | | Gets the action mapping as a convenience for pure Struts writer.
The base 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
ActionMapping See Also: ServletControllerRequest.setMapping |
getParamValues | public String[] getParamValues(String paramName)(Code) | | 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;
Parameters: paramName - key to look for among all parameters an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist. |
getServletRequest | public ServletRequest getServletRequest()(Code) | | 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.
If you do access the response object, you must also call setCustomOutput(true) in the
ControllResponse object to let the Controller container (ControllerServlet, ControllRun, etc)
know that it should not attempt to handle view processing itself.
Don't use it if you don't *need* it.
ServletRequest object See Also: ServletControllerRequest.getServletResponse See Also: ServletControllerRequest.setServletRequest |
getServletResponse | public ServletResponse getServletResponse()(Code) | | 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.
If you do access the response object, you must also call setCustomOutput(true) in the
ControllResponse object to let the Controller container (ControllerServlet, ControllRun, etc)
know that it should not attempt to handle view processing itself.
Don't use it if you don't *need* it.
ServletResponse object See Also: ServletControllerRequest.getServletRequest See Also: ServletControllerRequest.setServletResponse |
parseParamsMultiPart | public static ServletControllerRequest parseParamsMultiPart(MultipartRequestHandler mp, ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, Controller controller) throws ServletException, ControllerException(Code) | | Static constructor for creating an servlet controller request
with all the acoutrements of the Struts Action execution signature.
I deliberate add the 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
Parameters: mapping - The ActionMapping used to select this instance Parameters: form - The optional ActionForm bean for this request (if any) Parameters: request - the Servlet Request Parameters: response - the Servlet Response Parameters: controller - the Controller throws: ControllerException - exception upon controller error throws: ServletException - upon javax.servlet related errors |
setForm | public synchronized void setForm(ActionForm newForm)(Code) | | Sets the action form as a convenience for pure Struts writer.
author Peter Pilgrim Fri Jan 23 23:40:14 GMT 2004
Parameters: newForm - the ActionForm associated with the controller request See Also: ServletControllerRequest.getForm |
setMapping | public synchronized void setMapping(ActionMapping newMapping)(Code) | | Sets the action mapping as a convenience for pure Struts writer
author Peter Pilgrim
Parameters: newMapping - the ActionMapping associated with the controller request See Also: ServletControllerRequest.getMapping |
Methods inherited from com.jcorporate.expresso.core.controller.ControllerRequest | public Object clone()(Code)(Java Doc) public Object getAttrib(String attrib)(Code)(Java Doc) public String getAttribute(String attrib)(Code)(Java Doc) public Map getAttributes()(Code)(Java Doc) public String getDBName()(Code)(Java Doc) public String getDataContext()(Code)(Java Doc) public ErrorCollection getErrorCollection() throws ControllerException(Code)(Java Doc) public String getFileName(String paramName)(Code)(Java Doc) public String getFormAttribute()(Code)(Java Doc) public String getInitParameter(String paramName)(Code)(Java Doc) public Locale getLocale()(Code)(Java Doc) public Object getObjectParameter(String paramName) throws ControllerException(Code)(Java Doc) public String getParameter(String paramCode)(Code)(Java Doc) public Hashtable getParameters()(Code)(Java Doc) public PersistentSession getSession() throws ControllerException(Code)(Java Doc) public int getUid()(Code)(Java Doc) public String getUser()(Code)(Java Doc) public User getUserInfo() throws DBException(Code)(Java Doc) public boolean isFileParameter(String paramName)(Code)(Java Doc) public boolean isParameter(String paramName)(Code)(Java Doc) public void populate(DBObject myDBObj) throws ControllerException(Code)(Java Doc) public void removeAttrib(String key)(Code)(Java Doc) public void removeParameter(String paramName)(Code)(Java Doc) public void setAttrib(String attrib, Object val)(Code)(Java Doc) public void setAttribute(String attrib, String val)(Code)(Java Doc) public void setAttributes(Map attributes)(Code)(Java Doc) public synchronized void setDBName(String newDBName)(Code)(Java Doc) public synchronized void setDataContext(String newDBName)(Code)(Java Doc) public void setFileParameter(String paramName, String paramValue, String fileName) throws ControllerException(Code)(Java Doc) public synchronized void setFormAttribute(String newAttribute)(Code)(Java Doc) public void setInitParameter(String paramName, String paramValue)(Code)(Java Doc) public synchronized void setLocale(Locale newLocale)(Code)(Java Doc) public void setObjectParameter(String paramName, Object paramValue) throws ControllerException(Code)(Java Doc) public void setParameter(String paramName, String paramValue) throws ControllerException(Code)(Java Doc) public void setParameters(Hashtable h)(Code)(Java Doc) public void setSession(PersistentSession newSession) throws ControllerException(Code)(Java Doc) public void setUid(int newUid)(Code)(Java Doc) public void setUser(String newUser)(Code)(Java Doc) public void validateDBField(String dbFieldName, DBObject oneObject, ErrorCollection ec) throws ControllerException, DBException(Code)(Java Doc) public void validateDBObject(DBObject oneObject, ErrorCollection ec) throws ControllerException, ValidationException(Code)(Java Doc) public void validateField(String dbFieldName, String reqFieldName, DBObject oneObject, ErrorCollection ec) throws ControllerException, DBException(Code)(Java Doc)
|
|
|