Package com.iisigroup.cap.response

Examples of com.iisigroup.cap.response.IResult


    if (locale != null) {
      SimpleContextHolder.put(CapWebUtil.localeKey, locale);
    } else {
      SimpleContextHolder.put(CapWebUtil.localeKey, Locale.getDefault());
    }
    IResult result = null;
    Logger pluginlogger = logger;
    IRequest request = getDefaultRequest(req);
    try {
      request.setParameter(FormHandler.FORM_ACTION, action);
      HandlerPlugin plugin = pluginMgr.getPlugin(handler);
      logger.info("plugin:" + handler + " - "
          + plugin.getClass().getSimpleName() + " action:" + action);
      plugin.setRequest(request);
      pluginlogger = LoggerFactory.getLogger(plugin.getClass());
      result = plugin.execute(request);

    } catch (Exception e) {
      IErrorResult errorResult = getDefaultErrorResult();
      if (errorResult == null) {
        result = new ErrorResult(request, e);
      } else {
        errorResult.putError(request, e);
        result = errorResult;
      }
      if (e instanceof CapMessageException) {
        pluginlogger.error(result.getResult().toString());
      } else if (e instanceof CapException && e.getCause() != null) {
        pluginlogger.error(result.getResult().toString(), e.getCause());
      } else {
        pluginlogger.error(result.getResult().toString(), e);
      }
      if (!"true".equals(request.get("iframe"))) {
        resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);
      }
    } finally {
      result.respondResult(resp);
      logger.debug("total spend time : {} ms",
          (System.currentTimeMillis() - st));
      if (logger.isTraceEnabled()) {
        logger.trace("Response Data : " + result.getLogMessage());
      }
      SimpleContextHolder.resetContext();
    }
  }// ;
View Full Code Here


      this.executeHandler = executeObj;
    }

    @Override
    public IResult doWork(IRequest params) {
      IResult rtn = null;
      String methodId = params.get(FORM_ACTION);
      if (CapString.isEmpty(methodId)) {
        methodId = "doWork";
      }
      boolean hasMethod = false;
View Full Code Here

          k.toArray(new String[k.size()]), locale);
      mresult.setResultMap(m);
    }
    if (aKeys.length > 0 && !CapString.isEmpty(aKeys[0])) {
      Class[] paramTypes = { IRequest.class };
      IResult rtn = null;
      for (String key : aKeys) {
        if (mresult.containsKey(key)) {
          continue;
        }
        Method method = ReflectionUtils.findMethod(this.getClass(),
View Full Code Here

public class CapHandleOpStep extends AbstractCustomizeOpStep {

  @Override
  public OpStepContext execute(OpStepContext ctx, IRequest params,
      IHandler handler) {
    IResult rtn = null;
    @SuppressWarnings("static-access")
    String actionType = params.get(handler.FORM_ACTION);
    //setName(handler.getHandlerName() + "." + actionType);
    IAction action = handler.getAction(actionType);
    rtn = action.doWork(params);
View Full Code Here

TOP

Related Classes of com.iisigroup.cap.response.IResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.