org.apache.taglibs.standard.tag.common.core.Util类的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(8.3k)|赞(0)|评价(0)|浏览(277)

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

Util介绍

[英]Utilities in support of tag-handler classes.
[中]支持标记处理程序类的实用程序。

代码示例

代码示例来源:origin: org.glassfish.web/jstl-impl

/**
 * Setter method for the scope of the variable to hold the
 * result.
 *
 */
public void setScope(String scope) {
  this.scope = Util.getScope(scope);
}

代码示例来源:origin: org.glassfish.web/jstl-impl

public static String escapeXml(String input) {
  if (input == null) return "";
  return Util.escapeXml(input);
}

代码示例来源:origin: org.glassfish.web/javax.servlet.jsp.jstl

private static Locale findFormattingMatch(PageContext pageContext,
           Locale[] avail) {
Locale match = null;
for (Enumeration enum_ = Util.getRequestLocales((HttpServletRequest)pageContext.getRequest());
   enum_.hasMoreElements(); ) {
    Locale locale = (Locale)enum_.nextElement();
  match = findFormattingMatch(locale, avail);
  if (match != null) {
  break;
  }
}

return match;
}

代码示例来源:origin: org.jboss.spec.javax.servlet.jstl/jboss-jstl-api_1.2_spec

private DateFormat createFormatter(Locale loc, String pattern) throws JspException {
    // Apply pattern, if present
    if (pattern != null) {
      return new SimpleDateFormat(pattern, loc);
    }

    if ((type == null) || DATE.equalsIgnoreCase(type)) {
      int style = Util.getStyle(dateStyle, "FORMAT_DATE_INVALID_DATE_STYLE");
      return DateFormat.getDateInstance(style, loc);
    } else if (TIME.equalsIgnoreCase(type)) {
      int style = Util.getStyle(timeStyle, "FORMAT_DATE_INVALID_TIME_STYLE");
      return DateFormat.getTimeInstance(style, loc);
    } else if (DATETIME.equalsIgnoreCase(type)) {
      int style1 = Util.getStyle(dateStyle, "FORMAT_DATE_INVALID_DATE_STYLE");
      int style2 = Util.getStyle(timeStyle, "FORMAT_DATE_INVALID_TIME_STYLE");
      return DateFormat.getDateTimeInstance(style1, style2, loc);
    } else {
      throw new JspException(Resources.getMessage("FORMAT_DATE_INVALID_TYPE", type));
    }
  }
}

代码示例来源:origin: org.glassfish.web/jstl-impl

charSet = Util.getContentTypeAttribute(contentType, "charset");
  if (charSet == null) charSet = DEFAULT_ENCODING;
} else {

代码示例来源:origin: org.glassfish.web/jstl-impl

public int doEndTag() throws JspException {
Tag t = findAncestorWithClass(this, ParamParent.class);
if (t == null)
  throw new JspTagException(
  Resources.getMessage("PARAM_OUTSIDE_PARENT"));
// take no action for null or empty names
if (name == null || name.equals(""))
  return EVAL_PAGE;
// send the parameter to the appropriate ancestor
ParamParent parent = (ParamParent) t;
String value = this.value;
if (value == null) {
  if (bodyContent == null || bodyContent.getString() == null)
  value = "";
  else
  value = bodyContent.getString().trim();
}
  if (encode) {
    // FIXME: revert to java.net.URLEncoder.encode(s, enc) once
    // we have a dependency on J2SE 1.4+.
    String enc = pageContext.getResponse().getCharacterEncoding();
    parent.addParameter(
    Util.URLEncode(name, enc), Util.URLEncode(value, enc));
  } else {
    parent.addParameter(name, value);
  }
return EVAL_PAGE;
}

代码示例来源:origin: org.glassfish.web/jstl-impl

if (c == ' ') {
out.append('+');
} else if (isSafeChar(c)) {
out.append((char)c);
} else {

代码示例来源:origin: org.jboss.spec.javax.servlet.jstl/jboss-jstl-api_1.2_spec

private static Locale findFormattingMatch(PageContext pageContext,
                     Locale[] avail) {
  Locale match = null;
  for (Enumeration enum_ = Util.getRequestLocales((HttpServletRequest) pageContext.getRequest());
     enum_.hasMoreElements();) {
    Locale locale = (Locale) enum_.nextElement();
    match = findFormattingMatch(locale, avail);
    if (match != null) {
      break;
    }
  }
  return match;
}

代码示例来源:origin: org.glassfish.web/jstl-impl

private DateFormat createFormatter(Locale loc) throws JspException {
  DateFormat formatter = null;

  if ((type == null) || DATE.equalsIgnoreCase(type)) {
    formatter = DateFormat.getDateInstance(
      Util.getStyle(dateStyle, "FORMAT_DATE_INVALID_DATE_STYLE"),
    loc);
  } else if (TIME.equalsIgnoreCase(type)) {
    formatter = DateFormat.getTimeInstance(
      Util.getStyle(timeStyle, "FORMAT_DATE_INVALID_TIME_STYLE"),
    loc);
  } else if (DATETIME.equalsIgnoreCase(type)) {
    formatter = DateFormat.getDateTimeInstance(
      Util.getStyle(dateStyle, "FORMAT_DATE_INVALID_DATE_STYLE"),
    Util.getStyle(timeStyle, "FORMAT_DATE_INVALID_TIME_STYLE"),
    loc);
  } else {
    throw new JspException(
          Resources.getMessage("FORMAT_DATE_INVALID_TYPE", 
           type));
  }

  return formatter;
  }
}

代码示例来源:origin: org.glassfish.web/javax.servlet.jsp.jstl

charSet = Util.getContentTypeAttribute(contentType, "charset");
  if (charSet == null) charSet = DEFAULT_ENCODING;
} else {

代码示例来源:origin: org.bluestemsoftware.open.maven.tparty/jsp-api-2.1

public int doEndTag() throws JspException {
Tag t = findAncestorWithClass(this, ParamParent.class);
if (t == null)
  throw new JspTagException(
  Resources.getMessage("PARAM_OUTSIDE_PARENT"));
// take no action for null or empty names
if (name == null || name.equals(""))
  return EVAL_PAGE;
// send the parameter to the appropriate ancestor
ParamParent parent = (ParamParent) t;
String value = this.value;
if (value == null) {
  if (bodyContent == null || bodyContent.getString() == null)
  value = "";
  else
  value = bodyContent.getString().trim();
}
  if (encode) {
    // FIXME: revert to java.net.URLEncoder.encode(s, enc) once
    // we have a dependency on J2SE 1.4+.
    String enc = pageContext.getResponse().getCharacterEncoding();
    parent.addParameter(
    Util.URLEncode(name, enc), Util.URLEncode(value, enc));
  } else {
    parent.addParameter(name, value);
  }
return EVAL_PAGE;
}

代码示例来源:origin: javax.servlet/com.springsource.javax.servlet.jsp.jstl

if (c == ' ') {
out.append('+');
} else if (isSafeChar(c)) {
out.append((char)c);
} else {

代码示例来源:origin: org.glassfish.web/jstl-impl

/**
 * Setter method for the scope of the variable to hold the
 * result.
 */
public void setScope(String scopeName) {
  scope = Util.getScope(scopeName);
}

代码示例来源:origin: org.apache.taglibs/taglibs-standard-impl

private static Locale findFormattingMatch(PageContext pageContext,
                     Locale[] avail) {
  Locale match = null;
  for (Enumeration enum_ = Util.getRequestLocales((HttpServletRequest) pageContext.getRequest());
     enum_.hasMoreElements();) {
    Locale locale = (Locale) enum_.nextElement();
    match = findFormattingMatch(locale, avail);
    if (match != null) {
      break;
    }
  }
  return match;
}

代码示例来源:origin: org.apache.taglibs/taglibs-standard-impl

private DateFormat createFormatter(Locale loc, String pattern) throws JspException {
    // Apply pattern, if present
    if (pattern != null) {
      return new SimpleDateFormat(pattern, loc);
    }

    if ((type == null) || DATE.equalsIgnoreCase(type)) {
      int style = Util.getStyle(dateStyle, "FORMAT_DATE_INVALID_DATE_STYLE");
      return DateFormat.getDateInstance(style, loc);
    } else if (TIME.equalsIgnoreCase(type)) {
      int style = Util.getStyle(timeStyle, "FORMAT_DATE_INVALID_TIME_STYLE");
      return DateFormat.getTimeInstance(style, loc);
    } else if (DATETIME.equalsIgnoreCase(type)) {
      int style1 = Util.getStyle(dateStyle, "FORMAT_DATE_INVALID_DATE_STYLE");
      int style2 = Util.getStyle(timeStyle, "FORMAT_DATE_INVALID_TIME_STYLE");
      return DateFormat.getDateTimeInstance(style1, style2, loc);
    } else {
      throw new JspException(Resources.getMessage("FORMAT_DATE_INVALID_TYPE", type));
    }
  }
}

代码示例来源:origin: javax.servlet/com.springsource.javax.servlet.jsp.jstl

charSet = Util.getContentTypeAttribute(contentType, "charset");
  if (charSet == null) charSet = DEFAULT_ENCODING;
} else {

代码示例来源:origin: org.eclipse.jetty.orbit/org.apache.taglibs.standard.glassfish

public static String escapeXml(String input) {
  if (input == null) return "";
  return Util.escapeXml(input);
}

代码示例来源:origin: org.glassfish.web/javax.servlet.jsp.jstl

public int doEndTag() throws JspException {
Tag t = findAncestorWithClass(this, ParamParent.class);
if (t == null)
  throw new JspTagException(
  Resources.getMessage("PARAM_OUTSIDE_PARENT"));
// take no action for null or empty names
if (name == null || name.equals(""))
  return EVAL_PAGE;
// send the parameter to the appropriate ancestor
ParamParent parent = (ParamParent) t;
String value = this.value;
if (value == null) {
  if (bodyContent == null || bodyContent.getString() == null)
  value = "";
  else
  value = bodyContent.getString().trim();
}
  if (encode) {
    // FIXME: revert to java.net.URLEncoder.encode(s, enc) once
    // we have a dependency on J2SE 1.4+.
    String enc = pageContext.getResponse().getCharacterEncoding();
    parent.addParameter(
    Util.URLEncode(name, enc), Util.URLEncode(value, enc));
  } else {
    parent.addParameter(name, value);
  }
return EVAL_PAGE;
}

代码示例来源:origin: org.apache.taglibs/com.springsource.org.apache.taglibs.standard

if (c == ' ') {
out.append('+');
} else if (isSafeChar(c)) {
out.append((char)c);
} else {

代码示例来源:origin: org.apache.taglibs/taglibs-standard-impl

/**
 * Setter method for the scope of the variable to hold the
 * result.
 */
public void setScope(String scope) {
  this.scope = Util.getScope(scope);
}

相关文章