javadoc polish

This commit is contained in:
Scott Andrews 2009-01-23 15:18:25 +00:00
parent 16843b3a07
commit 9335233618
4 changed files with 28 additions and 19 deletions

View File

@ -20,6 +20,9 @@ package org.springframework.web.servlet.tags;
* Bean used to pass name-value pair parameters from a {@link ParamTag} to a * Bean used to pass name-value pair parameters from a {@link ParamTag} to a
* {@link ParamAware} tag. * {@link ParamAware} tag.
* *
* <p>Attributes are the raw values passed to the spring:param tag and have not
* been encoded or escaped.
*
* @author Scott Andrews * @author Scott Andrews
* @since 3.0 * @since 3.0
* @see ParamTag * @see ParamTag
@ -31,28 +34,28 @@ public class Param {
private String value; private String value;
/** /**
* @return the non-encoded parameter name * @return the raw parameter name
*/ */
public String getName() { public String getName() {
return name; return name;
} }
/** /**
* Set the non-encoded name of the parameter * Set the raw name of the parameter
*/ */
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
/** /**
* @return the non-encoded parameter value * @return the raw parameter value
*/ */
public String getValue() { public String getValue() {
return value; return value;
} }
/** /**
* Set the non-encoded value of the parameter * Set the raw value of the parameter
*/ */
public void setValue(String value) { public void setValue(String value) {
this.value = value; this.value = value;

View File

@ -23,8 +23,7 @@ import javax.servlet.jsp.tagext.BodyTagSupport;
* JSP tag for collecting name-value parameters and passing them to a * JSP tag for collecting name-value parameters and passing them to a
* {@link ParamAware} ancestor in the tag hierarchy. * {@link ParamAware} ancestor in the tag hierarchy.
* *
* <p> * <p>This tag must be nested under a param aware tag.
* This tag must be nested under a param aware tag.
* *
* @author Scott Andrews * @author Scott Andrews
* @since 3.0 * @since 3.0

View File

@ -37,26 +37,33 @@ import org.springframework.web.util.TagUtils;
* JSP tag for creating URLs. Modeled after the JSTL c:url tag with backwards * JSP tag for creating URLs. Modeled after the JSTL c:url tag with backwards
* compatibility in mind. * compatibility in mind.
* *
* <p> * <p>Enhancements to the JSTL functionality include:
* Enhancements to the JSTL functionality include:
* <ul> * <ul>
* <li>URL encoded template URI variables</li> * <li>URL encoded template URI variables</li>
* <li>Server and servlet relative URLs in addition to the standard context
* relative.</li>
* <li>XML escaping of URLs</li> * <li>XML escaping of URLs</li>
* </ul> * </ul>
* *
* <p> * <p>Template URI variables are indicated in the {@link #setValue(String) 'value'}
* Template URI variables are indicated in the {@link #setValue(String) 'value'} * attribute and marked by braces '{variableName}'. The braces and attribute name are
* attribute and marked by braces '{}'. The braces and attribute name are * replaced by the URL encoded value of a parameter defined with the spring:param tag
* replaced by the URL encoded value of a parameter. If no parameter is * in the body of the url tag. If no parameter is available the literal value is
* available the literal value is passed through. Params matched to template * passed through. Params matched to template variables will not be added to the query
* variables will not be added to the query string. * string.
* *
* <p> * <p>Use of the spring:param tag for URI template variables is strongly recommended
* URLs can be XML escaped by setting the {@link #setEscapeXml(String) * over direct EL substitution as the values are URL encoded. Failure to properly
* encode URL can leave an application vulnerable to XSS and other injection attacks.
*
* <p>URLs can be XML escaped by setting the {@link #setEscapeXml(String)
* 'escapeXml'} attribute to 'true', the default is 'false'. * 'escapeXml'} attribute to 'true', the default is 'false'.
* *
* <p>Example usage:
* <pre>&lt;spring:url value="/url/path/{variableName}"&gt;
* &lt;spring:param name="variableName" value="more than JSTL c:url" /&gt;
* &lt;/spring:url&gt;</pre>
* Results in:
* <code>/currentApplicationContext/url/path/more+than+JSTL+c%3Aurl</code>
*
* @author Scott Andrews * @author Scott Andrews
* @since 3.0 * @since 3.0
* @see ParamTag * @see ParamTag

View File

@ -385,7 +385,7 @@
<description>Escape XML special characters in the resulting URL. 'true' and <description>Escape XML special characters in the resulting URL. 'true' and
'false' are supported. Defaults to 'false' to maintain compatibility with 'false' are supported. Defaults to 'false' to maintain compatibility with
the JSTL c:url tag. Strongly recommended to set as 'true' when rendering the JSTL c:url tag. Strongly recommended to set as 'true' when rendering
directly to the JspWriter in an XML or HTML based file.</description> directly to the JspWriter in an XML or HTML based document.</description>
</attribute> </attribute>
</tag> </tag>