⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dispatchforward.java

📁 本例主要是利用GSM设备实现手机短信采集数据
💻 JAVA
字号:
//---------------------------------------------------------
// Application: Gsm of Application
// Author     : esingle
// File       : DispatchForward.java
//
// Copyright 2004 landsoft corp
// Generated at Wed Mar 10 15:35:57 CST 2004
// created by 曹广鑫
// mailto:gxcao@mail.tsinghua.edu.cn
//---------------------------------------------------------

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 + -