?? dispatchforward.java
字號:
package com.landsoft.gsm.controller;
import org.apache.struts.action.*;
import javax.servlet.http.*;
public final class DispatchForward extends Action {
/**
* Forward request to "cancel", {forward}, or "error" mapping, where
* {forward} is an action path given in the parameter mapping or in the
* request as "forward=actionPath".
*
*@param mapping The ActionMapping used to select this instance
*@param request The HTTP request we are processing
*@param response The HTTP response we are creating
*@param form Description of Parameter
*@return Description of the Returned Value
*/
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
// -- isCancelled?
if (isCancelled(request)) {
form.reset(mapping, request);
return (mapping.findForward("cancel"));
}
// -- Locals
ActionForward thisForward = null;
String wantForward = null;
// -- Check internal parameter for forward
wantForward = mapping.getParameter();
// -- If not found, check request for forward
if (wantForward == null) {
wantForward = request.getParameter("forward");
}
// -- If found, consult mappings
if (wantForward != null) {
thisForward = mapping.findForward(wantForward);
}
// -- If anything not found, dispatch error
if (thisForward == null) {
thisForward = mapping.findForward("error");
ActionErrors errors = new ActionErrors();
errors.add(ActionErrors.GLOBAL_ERROR,
new ActionError("action.missing.parameter"));
saveErrors(request, errors);
}
return thisForward;
}
// end perform
}
// end Action
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -