gpt4 book ai didi

org.springframework.extensions.webscripts.WebScriptException.getStatus()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 21:21:05 25 4
gpt4 key购买 nike

本文整理了Java中org.springframework.extensions.webscripts.WebScriptException.getStatus()方法的一些代码示例,展示了WebScriptException.getStatus()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebScriptException.getStatus()方法的具体详情如下:
包路径:org.springframework.extensions.webscripts.WebScriptException
类名称:WebScriptException
方法名:getStatus

WebScriptException.getStatus介绍

[英]Get status code
[中]获取状态码

代码示例

代码示例来源:origin: org.alfresco.surf/spring-surf

/**
   * @see org.springframework.extensions.webscripts.AbstractRuntime#beforeProcessError(org.springframework.extensions.webscripts.Match, java.lang.Throwable)
   * 
   * Override this hook to add special handling for "missing" WebScript components.
   * The page renderer can safely ignore components that no longer map to a URL. It
   * is recommended that that the debug flag is used to view missing webscript URLs.
   */
  @Override
  protected boolean beforeProcessError(Match match, Throwable e)
  {
    if (e instanceof WebScriptException && ((WebScriptException)e).getStatus() == HttpServletResponse.SC_NOT_FOUND)
    {
      // log info on server if we are debugging
      if (logger.isDebugEnabled())
      {
        logger.debug(e.getMessage());
      }
      return false;
    }
    else
    {
      return super.beforeProcessError(match, e);
    }
  }
}

代码示例来源:origin: org.alfresco.surf/spring-webscripts

statusCode = we.getStatus();
statusTemplate = we.getStatusTemplate();
statusModel = we.getStatusModel();

代码示例来源:origin: deas/alfresco

if (e instanceof WebScriptException && (((WebScriptException)e).getStatus() == HttpServletResponse.SC_NOT_FOUND || 
                    ((WebScriptException)e).getStatus() == HttpServletResponse.SC_UNAUTHORIZED))
  String errorCode = ((WebScriptException)e).getStatus() == HttpServletResponse.SC_NOT_FOUND ? "NOT FOUND" : "UNAUTHORIZED";
  logger.debug("Webscript did not execute. (" + errorCode + "): " + e.getMessage());
  statusCode = we.getStatus();
  statusTemplate = we.getStatusTemplate();
  statusModel = we.getStatusModel();

代码示例来源:origin: org.springframework.extensions.surf/spring-surf

/**
   * @see org.springframework.extensions.webscripts.AbstractRuntime#beforeProcessError(org.springframework.extensions.webscripts.Match, java.lang.Throwable)
   * 
   * Override this hook to add special handling for "missing" WebScript components.
   * The page renderer can safely ignore components that no longer map to a URL. It
   * is recommended that that the debug flag is used to view missing webscript URLs.
   */
  @Override
  protected boolean beforeProcessError(Match match, Throwable e)
  {
    if (e instanceof WebScriptException && ((WebScriptException)e).getStatus() == HttpServletResponse.SC_NOT_FOUND)
    {
      // log info on server if we are debugging
      if (logger.isDebugEnabled())
      {
        logger.debug(e.getMessage());
      }
      return false;
    }
    else
    {
      return super.beforeProcessError(match, e);
    }
  }
}

代码示例来源:origin: org.springframework.extensions.surf/spring-webscripts

if (e instanceof WebScriptException && (((WebScriptException)e).getStatus() == HttpServletResponse.SC_NOT_FOUND || 
                    ((WebScriptException)e).getStatus() == HttpServletResponse.SC_UNAUTHORIZED))
  String errorCode = ((WebScriptException)e).getStatus() == HttpServletResponse.SC_NOT_FOUND ? "NOT FOUND" : "UNAUTHORIZED";
  logger.debug("Webscript did not execute. (" + errorCode + "): " + e.getMessage());
  statusCode = we.getStatus();
  statusTemplate = we.getStatusTemplate();
  statusModel = we.getStatusModel();

代码示例来源:origin: deas/alfresco

public StatusTemplate getStatusTemplate()
  {
    int statusCode = we.getStatus();
    String format = req.getFormat();
    String scriptId = getDescription().getId();
    return AbstractWebScript.this.getStatusTemplate(scriptId, statusCode, (format == null) ? "" : format);
  }
});

代码示例来源:origin: org.alfresco.surf/spring-webscripts

public StatusTemplate getStatusTemplate()
  {
    int statusCode = we.getStatus();
    String format = req.getFormat();
    String scriptId = getDescription().getId();
    return AbstractWebScript.this.getStatusTemplate(scriptId, statusCode, (format == null) ? "" : format);
  }
});

代码示例来源:origin: org.springframework.extensions.surf/spring-webscripts

public StatusTemplate getStatusTemplate()
  {
    int statusCode = we.getStatus();
    String format = req.getFormat();
    String scriptId = getDescription().getId();
    return AbstractWebScript.this.getStatusTemplate(scriptId, statusCode, (format == null) ? "" : format);
  }
});

代码示例来源:origin: org.alfresco.surf/spring-webscripts

if (e instanceof WebScriptException && (((WebScriptException)e).getStatus() == HttpServletResponse.SC_NOT_FOUND || 
                    ((WebScriptException)e).getStatus() == HttpServletResponse.SC_UNAUTHORIZED))
  String errorCode = ((WebScriptException)e).getStatus() == HttpServletResponse.SC_NOT_FOUND ? "NOT FOUND" : "UNAUTHORIZED";
  logger.debug("Webscript did not execute. (" + errorCode + "): " + e.getMessage());

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com