org.esupportail.commons.utils.Assert.hasText()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(189)

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

Assert.hasText介绍

暂无

代码示例

代码示例来源:origin: org.esupportail/esup-commons2-hibernate

@Override
public void afterPropertiesSet() throws Exception {
  super.afterPropertiesSet();
  if (jdbcUpgradeSessionFactoryBeanName == null && jndiUpgradeSessionFactoryBeanName == null) {
    throw new ConfigException("properties [jdbcUpgradeSessionFactoryBeanName] "
        + "and [jndiUpgradeSessionFactoryBeanName] of class ["
        + getClass().getName() + "] can not be both null");
  }
  Assert.hasText(createSessionFactoryBeanName,
      "property [createSessionFactoryBeanName] of class ["
      + getClass().getName() + "] can not be null");
}

代码示例来源:origin: org.esupportail/example-web-jsf-shared

/**
 * JSF callback.
 * @return a String.
 * @throws IOException 
 */
public String logout() throws IOException {
  if (ContextUtils.isPortlet()) {
    throw new UnsupportedOperationException("logout() should not be called in portlet mode.");
  }
  FacesContext facesContext = FacesContext.getCurrentInstance();
  ExternalContext externalContext = facesContext.getExternalContext();
  HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();
  String returnUrl = request.getRequestURL().toString().replaceFirst("/stylesheets/[^/]*$", "");
  String forwardUrl;
  Assert.hasText(
      casLogoutUrl, 
      "property casLogoutUrl of class " + getClass().getName() + " is null");
  forwardUrl = String.format(casLogoutUrl, StringUtils.utf8UrlEncode(returnUrl));
  // note: the session beans will be kept even when invalidating 
  // the session so they have to be reset (by the exception controller).
  // We invalidate the session however for the other attributes.
  request.getSession().invalidate();
  request.getSession(true);
  // calling this method will reset all the beans of the application
  exceptionController.restart();
  externalContext.redirect(forwardUrl);
  facesContext.responseComplete();
  return null;
}

代码示例来源:origin: org.esupportail/ects-web-jsf-shared

/**
 * JSF callback.
 * @return a String.
 * @throws IOException 
 */
public String logout() throws IOException {
  if (ContextUtils.isPortlet()) {
    throw new UnsupportedOperationException("logout() should not be called in portlet mode.");
  }
  FacesContext facesContext = FacesContext.getCurrentInstance();
  ExternalContext externalContext = facesContext.getExternalContext();
  HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();
  String returnUrl = request.getRequestURL().toString().replaceFirst("/stylesheets/[^/]*$", "");
  String forwardUrl;
  Assert.hasText(
      casLogoutUrl, 
      "property casLogoutUrl of class " + getClass().getName() + " is null");
  forwardUrl = String.format(casLogoutUrl, StringUtils.utf8UrlEncode(returnUrl));
  // note: the session beans will be kept even when invalidating 
  // the session so they have to be reset (by the exception controller).
  // We invalidate the session however for the other attributes.
  request.getSession().invalidate();
  request.getSession(true);
  // calling this method will reset all the beans of the application
  exceptionController.restart();
  externalContext.redirect(forwardUrl);
  facesContext.responseComplete();
  return null;
}

相关文章