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

📄 frameworkstrutsaction.java

📁 Speedframework--基于类型元数据的羽量级ORM.完全基于Java类型元数据和反射机制同时不需要任何对象关系映射配置文件的轻量级ORM框架,它充分利用了类型本身的信息,使用Metadata
💻 JAVA
字号:
package org.speedframework.action;

import javax.servlet.http.*;

import org.apache.struts.action.*;
import org.apache.struts.actions.*;

/**
 * <p>Title: SpeedFrameworkWork持久层框架</p>
 *
 * <p>Description: Struts Action基类</p>
 *
 * <p>Copyright: Copyright (c) 2005</p>
 *
 * <p>Company: SpeedFrameworkWork</p>
 * @author 李志峰 电话:13824431576
 * @version 1.1beta
 */
public class FrameworkStrutsAction
    extends DispatchAction {
  /**
   * FrameworkStrutsAction
   * @Deprecated
   */
  public FrameworkStrutsAction() {
  }

  /**
   * 移除内存里的FormBean
   *
   * @param mapping ActionMapping
   * @param request HttpServletRequest
   */
  protected void removeFormBean(ActionMapping mapping,
                                HttpServletRequest request) {
    // Remove the obsolete form bean
    if (mapping.getAttribute() != null) {
      if ("request".equals(mapping.getScope())) {
        request.removeAttribute(mapping.getAttribute());
      }
      else {
        HttpSession session = request.getSession();
        session.removeAttribute(mapping.getAttribute());
      }
    }
  }

  /**
   * 更新内存里的FormBean
   *
   * @param mapping ActionMapping
   * @param request HttpServletRequest
   * @param form ActionForm
   */
  protected void updateFormBean(ActionMapping mapping,
                                HttpServletRequest request, ActionForm form) {
    // Remove the obsolete form bean
    if (mapping.getAttribute() != null) {
      if ("request".equals(mapping.getScope())) {
        request.setAttribute(mapping.getAttribute(), form);
      }
      else {
        HttpSession session = request.getSession();
        session.setAttribute(mapping.getAttribute(), form);
      }
    }
  }

  protected ActionErrors addError(String ex) {
    ActionErrors errors = new ActionErrors();
    ActionError error = new ActionError(ex);
    errors.add(ActionErrors.GLOBAL_ERROR, error);
    return errors;
  }

  protected ActionMessages addMssages(String ex) {
    ActionMessages msgs = new ActionMessages();
    msgs.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(ex));
    return msgs;
  }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -