本文整理了Java中org.apache.taglibs.standard.tag.common.core.Util.URLEncode()
方法的一些代码示例,展示了Util.URLEncode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.URLEncode()
方法的具体详情如下:
包路径:org.apache.taglibs.standard.tag.common.core.Util
类名称:Util
方法名:URLEncode
[英]URL encodes a string, based on the supplied character encoding. This performs the same function as java.next.URLEncode.encode in J2SDK1.4, and should be removed if the only platform supported is 1.4 or higher.
[中]URL根据提供的字符编码对字符串进行编码。它执行与java相同的功能。下一个URL编码。用J2SDK1编码。4,如果唯一支持的平台为1.4或更高,则应移除。
代码示例来源: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.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: org.eclipse.jetty.orbit/org.apache.taglibs.standard.glassfish
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/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: javax.servlet/com.springsource.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
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;
}
内容来源于网络,如有侵权,请联系作者删除!