gpt4 book ai didi

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

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

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

WebScriptException.<init>介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

@Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) {
  if (condition) {
  // Do something
  } else {
      throw new WebScriptException("Action is failed");                        
      }
  }

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

public void afterPropertiesSet()
  throws Exception
{
  if (defaultWebScript == null || defaultWebScript.length() == 0 || !applicationContext.containsBean(defaultWebScript))
  {
    throw new WebScriptException("Default Web Script implementation '" + (defaultWebScript == null ? "<undefined>" : defaultWebScript) + "' does not exist.");
  }
}

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

public void afterPropertiesSet()
  throws Exception
{
  if (defaultWebScript == null || defaultWebScript.length() == 0 || !applicationContext.containsBean(defaultWebScript))
  {
    throw new WebScriptException("Default Web Script implementation '" + (defaultWebScript == null ? "<undefined>" : defaultWebScript) + "' does not exist.");
  }
}

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

public boolean hasTemplate(String templatePath)
{
  boolean hasTemplate = false;
  try
  {
    Template template = templateConfig.getTemplate(templatePath);
    hasTemplate = (template != null);
  }
  catch(FileNotFoundException e)
  {
    // NOTE: return false as template is not found
  }
  catch(IOException e)
  {
    throw new WebScriptException("Failed to retrieve template " + templatePath, e);
  }
  return hasTemplate;
}

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

public void afterPropertiesSet()
  throws Exception
{
  if (defaultWebScript == null || defaultWebScript.length() == 0 || !applicationContext.containsBean(defaultWebScript))
  {
    throw new WebScriptException("Default Web Script implementation '" + (defaultWebScript == null ? "<undefined>" : defaultWebScript) + "' does not exist.");
  }
}

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

public InputStream getInputStream()
{
  try
  {
    return this.location.getInputStream();
  }
  catch (IOException e)
  {
    throw new WebScriptException("Unable to retrieve input stream for script " + getPathDescription());
  }
}

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

public InputStream getInputStream()
{
  try
  {
    return this.location.getInputStream();
  }
  catch (IOException e)
  {
    throw new WebScriptException("Unable to retrieve input stream for script " + getPathDescription());
  }
}

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

public InputStream getInputStream()
{
  try
  {
    return this.location.getInputStream();
  }
  catch (IOException e)
  {
    throw new WebScriptException("Unable to retrieve input stream for script " + getPathDescription());
  }
}

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

public Content getContent()
{
  // ensure we only try to read the content once - as this method may be called several times
  // but the underlying inputstream itself can only be processed a single time
  if (content == null)
  {
    try
    {
      content = new InputStreamContent(req.getInputStream(), getContentType(), req.getCharacterEncoding());
    }
    catch(IOException e)
    {
      throw new WebScriptException("Failed to retrieve request content", e);
    }
  }
  return content;
}

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

public Content getContent()
{
  // ensure we only try to read the content once - as this method may be called several times
  // but the underlying inputstream itself can only be processed a single time
  if (content == null)
  {
    try
    {
      content = new InputStreamContent(req.getInputStream(), getContentType(), req.getCharacterEncoding());
    }
    catch(IOException e)
    {
      throw new WebScriptException("Failed to retrieve request content", e);
    }
  }
  return content;
}

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

public Object executeScript(String path, Map<String, Object> model)
{
  // locate script within web script stores
  ScriptContent scriptLocation = findScript(path);
  if (scriptLocation == null)
  {
    throw new WebScriptException("Unable to locate script " + path);
  }
  // execute script
  return executeScript(scriptLocation, model);
}

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

public Object executeScript(String path, Map<String, Object> model)
{
  // locate script within web script stores
  ScriptContent scriptLocation = findScript(path);
  if (scriptLocation == null)
  {
    throw new WebScriptException("Unable to locate script " + path);
  }
  // execute script
  return executeScript(scriptLocation, model);
}

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

public FormData read(WebScriptRequest req)
{
  if (!(req instanceof WebScriptServletRequest))
  {
    throw new WebScriptException("Failed to convert request to FormData");
  }
  return new FormData(((WebScriptServletRequest)req).getHttpServletRequest());
}

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

public FormData read(WebScriptRequest req)
{
  if (!(req instanceof WebScriptServletRequest))
  {
    throw new WebScriptException("Failed to convert request to FormData");
  }
  return new FormData(((WebScriptServletRequest)req).getHttpServletRequest());
}

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

public Object executeScript(String path, Map<String, Object> model)
{
  // locate script within web script stores
  ScriptContent scriptLocation = findScript(path);
  if (scriptLocation == null)
  {
    throw new WebScriptException("Unable to locate script " + path);
  }
  // execute script
  return executeScript(scriptLocation, model);
}

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

public FormData read(WebScriptRequest req)
{
  if (!(req instanceof WebScriptServletRequest))
  {
    throw new WebScriptException("Failed to convert request to FormData");
  }
  return new FormData(((WebScriptServletRequest)req).getHttpServletRequest());
}

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

/**
 * Initializes the script loaders
 */
protected void initLoaders() 
{
  List<ScriptLoader> loaders = new ArrayList<ScriptLoader>(searchPath.getStores().size());
  for (Store apiStore : searchPath.getStores())
  {
    ScriptLoader loader = apiStore.getScriptLoader();
    if (loader == null)
    {
      throw new WebScriptException("Unable to retrieve script loader for Web Script store " + apiStore.getBasePath());
    }
    loaders.add(loader);
  }
  this.scriptLoader = new MultiScriptLoader(loaders.toArray(new ScriptLoader[loaders.size()]));
}

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

/**
 * Initializes the script loaders
 */
protected void initLoaders() 
{
  List<ScriptLoader> loaders = new ArrayList<ScriptLoader>(searchPath.getStores().size());
  for (Store apiStore : searchPath.getStores())
  {
    ScriptLoader loader = apiStore.getScriptLoader();
    if (loader == null)
    {
      throw new WebScriptException("Unable to retrieve script loader for Web Script store " + apiStore.getBasePath());
    }
    loaders.add(loader);
  }
  this.scriptLoader = new MultiScriptLoader(loaders.toArray(new ScriptLoader[loaders.size()]));
}

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

/**
 * Initializes the script loaders
 */
protected void initLoaders() 
{
  List<ScriptLoader> loaders = new ArrayList<ScriptLoader>(searchPath.getStores().size());
  for (Store apiStore : searchPath.getStores())
  {
    ScriptLoader loader = apiStore.getScriptLoader();
    if (loader == null)
    {
      throw new WebScriptException("Unable to retrieve script loader for Web Script store " + apiStore.getBasePath());
    }
    loaders.add(loader);
  }
  this.scriptLoader = new MultiScriptLoader(loaders.toArray(new ScriptLoader[loaders.size()]));
}

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

/**
 * Render a template (contents as string)
 *  
 * @param template  the template
 * @param model  model
 * @param writer  output writer
 * @param extension optional template extension type (i.e. ftl, php) 
 */
final protected void renderString(String template, Map<String, Object> model, Writer writer, String extension)
{        
  TemplateProcessor processor = container.getTemplateProcessorRegistry().getTemplateProcessorByExtension(extension);
  
  if (processor != null)
  {
    processor.processString(template, model, writer);
  }
  else
  {
    throw new WebScriptException("No processor found for extension " + extension);
  }
}

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