/** * Setter method for the scope of the variable to hold the * result. * */ public void setScope(String scope) { this.scope = Util.getScope(scope); }
public static String escapeXml(String input) { if (input == null) return ""; return Util.escapeXml(input); }
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; }
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)); } } }
charSet = Util.getContentTypeAttribute(contentType, "charset"); if (charSet == null) charSet = DEFAULT_ENCODING; } else {
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; }
if (c == ' ') { out.append('+'); } else if (isSafeChar(c)) { out.append((char)c); } else {
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; }
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; } }
charSet = Util.getContentTypeAttribute(contentType, "charset"); if (charSet == null) charSet = DEFAULT_ENCODING; } else {
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; }
if (c == ' ') { out.append('+'); } else if (isSafeChar(c)) { out.append((char)c); } else {
/** * Setter method for the scope of the variable to hold the * result. */ public void setScope(String scopeName) { scope = Util.getScope(scopeName); }
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; }
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)); } } }
charSet = Util.getContentTypeAttribute(contentType, "charset"); if (charSet == null) charSet = DEFAULT_ENCODING; } else {
public static String escapeXml(String input) { if (input == null) return ""; return Util.escapeXml(input); }
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; }
if (c == ' ') { out.append('+'); } else if (isSafeChar(c)) { out.append((char)c); } else {
/** * Setter method for the scope of the variable to hold the * result. */ public void setScope(String scope) { this.scope = Util.getScope(scope); }