Skip to content

Commit

Permalink
Migrate JSP tag library appendix reference to Javadoc.
Browse files Browse the repository at this point in the history
The Javadoc on tag classes now has all the information including a
list of all tags at the package level, HTML tables listing tag
attributes in each tag class, and class level description that is
as good or in many cases better than what was in the reference.

Issue: SPR-16045
  • Loading branch information
rstoyanchev committed Oct 5, 2017
1 parent e5a5677 commit eea8ee2
Show file tree
Hide file tree
Showing 32 changed files with 3,014 additions and 2,613 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,31 @@
import org.springframework.lang.Nullable;

/**
* JSP tag for collecting arguments and passing them to an {@link ArgumentAware}
* ancestor in the tag hierarchy.
* The {@code <argument>} tag is based on the JSTL {@code fmt:param} tag.
* The purpose is to support arguments inside the message and theme tags.
*
* <p>This tag must be nested under an argument aware tag.
*
* <table>
* <caption>Attribute Summary</caption>
* <thead>
* <tr>
* <th class="colFirst">Attribute</th>
* <th class="colOne">Required?</th>
* <th class="colOne">Runtime Expression?</th>
* <th class="colLast">Description</th>
* </tr>
* </thead>
* <tbody>
* <tr class="altColor">
* <td>value</p></td>
* <td>false</p></td>
* <td>true</p></td>
* <td>The value of the argument.</p></td>
* </tr>
* </tbody>
* </table>
*
* @author Nicholas Williams
* @since 4.0
* @see MessageTag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,39 @@
import org.springframework.validation.Errors;

/**
* JSP tag that evaluates content if there are binding errors
* for a certain bean. Exports an "errors" variable of type
* {@link org.springframework.validation.Errors} for the given bean.
* This {@code <hasBindErrors>} tag provides an {@link Errors} instance in case of
* bind errors. The HTML escaping flag participates in a page-wide or
* application-wide setting (i.e. by HtmlEscapeTag or a "defaultHtmlEscape"
* context-param in web.xml).
*
* <table>
* <caption>Attribute Summary</caption>
* <thead>
* <tr>
* <th class="colFirst">Attribute</th>
* <th class="colOne">Required?</th>
* <th class="colOne">Runtime Expression?</th>
* <th class="colLast">Description</th>
* </tr>
* </thead>
* <tbody>
* <tr class="altColor">
* <td>htmlEscape</p></td>
* <td>false</p></td>
* <td>true</p></td>
* <td>Set HTML escaping for this tag, as boolean value.
* Overrides the default HTML escaping setting for the current page.</p></td>
* </tr>
* <tr class="rowColor">
* <td>name</p></td>
* <td>true</p></td>
* <td>true</p></td>
* <td>The name of the bean in the request that needs to be inspected for errors.
* If errors are available for this bean, they will be bound under the
* 'errors' key.</p></td>
* </tr>
* </tbody>
* </table>
*
* @author Rod Johnson
* @author Juergen Hoeller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.springframework.web.servlet.support.BindStatus;

/**
* Bind tag, supporting evaluation of binding errors for a certain
* The {@code <bind>} tag supports evaluation of binding errors for a certain
* bean or bean property. Exposes a "status" variable of type
* {@link org.springframework.web.servlet.support.BindStatus},
* to both Java expressions and JSP EL expressions.
Expand All @@ -42,6 +42,43 @@
* as the bean property that this errors object applies to. Nested tags
* such as the {@link TransformTag} can access those exposed properties.
*
* <table>
* <caption>Attribute Summary</caption>
* <thead>
* <tr>
* <th class="colFirst">Attribute</th>
* <th class="colOne">Required?</th>
* <th class="colOne">Runtime Expression?</th>
* <th class="colLast">Description</th>
* </tr>
* </thead>
* <tbody>
* <tr class="altColor">
* <td><p>htmlEscape</p></td>
* <td><p>false</p></td>
* <td><p>true</p></td>
* <td><p>Set HTML escaping for this tag, as boolean value. Overrides the default
* HTML escaping setting for the current page.</p></td>
* </tr>
* <tr class="rowColor">
* <td><p>ignoreNestedPath</p></td>
* <td><p>false</p></td>
* <td><p>true</p></td>
* <td><p>Set whether to ignore a nested path, if any.
* Default is to not ignore.</p></td>
* </tr>
* <tr class="altColor">
* <td><p>path</p></td>
* <td><p>true</p></td>
* <td><p>true</p></td>
* <td><p>The path to the bean or bean property to bind status information for.
* For instance account.name, company.address.zipCode or just employee. The status
* object will exported to the page scope, specifically for this bean or bean
* property</p></td>
* </tr>
* </tbody>
* </table>
*
* @author Rod Johnson
* @author Juergen Hoeller
* @see #setPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.springframework.web.util.JavaScriptUtils;

/**
* Custom JSP tag to escape its enclosed body content,
* The {@code <escapeBody>} tag is used to escape its enclosed body content,
* applying HTML escaping and/or JavaScript escaping.
*
* <p>Provides a "htmlEscape" property for explicitly specifying whether to
Expand All @@ -37,6 +37,33 @@
* <p>Provides a "javaScriptEscape" property for specifying whether to apply
* JavaScript escaping. Can be combined with HTML escaping or used standalone.
*
* <table>
* <caption>Attribute Summary</caption>
* <thead>
* <tr>
* <th class="colFirst">Attribute</th>
* <th class="colOne">Required?</th>
* <th class="colOne">Runtime Expression?</th>
* <th class="colLast">Description</th>
* </tr>
* <tbody>
* <tr class="altColor">
* <td>htmlEscape</p></td>
* <td>false</p></td>
* <td>true</p></td>
* <td>Set HTML escaping for this tag, as boolean value.
* Overrides the default HTML escaping setting for the current page.</p></td>
* </tr>
* <tr class="rowColor">
* <td>javaScriptEscape</p></td>
* <td>false</p></td>
* <td>true</p></td>
* <td>Set JavaScript escaping for this tag, as boolean value.
* Default is false.</p></td>
* </tr>
* </tbody>
* </table>
*
* @author Juergen Hoeller
* @since 1.1.1
* @see org.springframework.web.util.HtmlUtils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,59 @@
import org.springframework.web.util.TagUtils;

/**
* JSP tag for evaluating expressions with the Spring Expression Language (SpEL).
* Supports the standard JSP evaluation context consisting of implicit variables and scoped attributes.
* The {@code <eval>} tag evaluates a Spring expression (SpEL) and either prints
* the result or assigns it to a variable. Supports the standard JSP evaluation
* context consisting of implicit variables and scoped attributes.
*
* <table>
* <caption>Attribute Summary</caption>
* <thead>
* <tr>
* <th class="colFirst">Attribute</th>
* <th class="colOne">Required?</th>
* <th class="colOne">Runtime Expression?</th>
* <th class="colLast">Description</th>
* </tr>
* <tbody>
* <tr class="altColor">
* <td>expression</p></td>
* <td>true</p></td>
* <td>true</p></td>
* <td>The expression to evaluate.</p></td>
* </tr>
* <tr class="rowColor">
* <td>htmlEscape</p></td>
* <td>false</p></td>
* <td>true</p></td>
* <td>Set HTML escaping for this tag, as a boolean value.
* Overrides the default HTML escaping setting for the current page.</p></td>
* </tr>
* <tr class="altColor">
* <td>javaScriptEscape</p></td>
* <td>false</p></td>
* <td>true</p></td>
* <td>Set JavaScript escaping for this tag, as a boolean value.
* Default is false.</p></td>
* </tr>
* <tr class="rowColor">
* <td>scope</p></td>
* <td>false</p></td>
* <td>true</p></td>
* <td>The scope for the var. 'application', 'session', 'request' and 'page'
* scopes are supported. Defaults to page scope. This attribute has no effect
* unless the var attribute is also defined.</p></td>
* </tr>
* <tr class="altColor">
* <td>var</p></td>
* <td>false</p></td>
* <td>true</p></td>
* <td>The name of the variable to export the evaluation result to.
* If not specified the evaluation result is converted to a String and written
* as output.</p></td>
* </tr>
* </tbody>
* </table>
*
* @author Keith Donald
* @author Juergen Hoeller
* @since 3.0.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,34 @@
import javax.servlet.jsp.JspException;

/**
* Sets default HTML escape value for the current page. The actual value
* can be overridden by escaping-aware tags. The default is "false".
* The {@code <htmlEscape>} tag sets default HTML escape value for the current
* page. The actual value can be overridden by escaping-aware tags.
* The default is "false".
*
* <p>Note: You can also set a "defaultHtmlEscape" web.xml context-param.
* A page-level setting overrides a context-param.
*
* <table>
* <caption>Attribute Summary</caption>
* <thead>
* <tr>
* <th class="colFirst">Attribute</th>
* <th class="colOne">Required?</th>
* <th class="colOne">Runtime Expression?</th>
* <th class="colLast">Description</th>
* </tr>
* </thead>
* <tbody>
* <tr class="altColor">
* <td>defaultHtmlEscape</p></td>
* <td>true</p></td>
* <td>true</p></td>
* <td>Set the default value for HTML escaping, to be put into the current
* PageContext.</p></td>
* </tr>
* </tbody>
* </table>
*
* @author Juergen Hoeller
* @since 04.03.2003
* @see HtmlEscapingAwareTag#setHtmlEscape
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
import org.springframework.web.util.TagUtils;

/**
* Custom JSP tag to look up a message in the scope of this page. Messages are
* resolved using the ApplicationContext and thus support internationalization.
* The {@code <message>} tag looks up a message in the scope of this page.
* Messages are resolved using the ApplicationContext and thus support
* internationalization.
*
* <p>Detects an HTML escaping setting, either on this tag instance, the page level,
* or the {@code web.xml} level. Can also apply JavaScript escaping.
Expand All @@ -46,6 +47,91 @@
* <p>Message arguments can be specified via the {@link #setArguments(Object) arguments}
* attribute or by using nested {@code <spring:argument>} tags.
*
* <table>
* <caption>Attribute Summary</caption>
* <thead>
* <tr>
* <th class="colFirst">Attribute</th>
* <th class="colOne">Required?</th>
* <th class="colOne">Runtime Expression?</th>
* <th class="colLast">Description</th>
* </tr>
* </thead>
* <tbody>
* <tr class="altColor">
* <td>arguments</p></td>
* <td>false</p></td>
* <td>true</p></td>
* <td>Set optional message arguments for this tag, as a (comma-)delimited
* String (each String argument can contain JSP EL), an Object array (used as
* argument array), or a single Object (used as single argument).</p></td>
* </tr>
* <tr class="rowColor">
* <td>argumentSeparator</p></td>
* <td>false</p></td>
* <td>true</p></td>
* <td>The separator character to be used for splitting the arguments string
* value; defaults to a 'comma' (',').</p></td>
* </tr>
* <tr class="altColor">
* <td>code</p></td>
* <td>false</p></td>
* <td>true</p></td>
* <td>The code (key) to use when looking up the message.
* If code is not provided, the text attribute will be used.</p></td>
* </tr>
* <tr class="rowColor">
* <td>htmlEscape</p></td>
* <td>false</p></td>
* <td>true</p></td>
* <td>Set HTML escaping for this tag, as boolean value.
* Overrides the default HTML escaping setting for the current page.</p></td>
* </tr>
* <tr class="altColor">
* <td>javaScriptEscape</p></td>
* <td>false</p></td>
* <td>true</p></td>
* <td>Set JavaScript escaping for this tag, as boolean value.
* Default is false.</p></td>
* </tr>
* <tr class="rowColor">
* <td>message</p></td>
* <td>false</p></td>
* <td>true</p></td>
* <td>A MessageSourceResolvable argument (direct or through JSP EL).
* Fits nicely when used in conjunction with Spring’s own validation error
* classes which all implement the MessageSourceResolvable interface.
* For example, this allows you to iterate over all of the errors in a form,
* passing each error (using a runtime expression) as the value of this
* 'message' attribute, thus effecting the easy display of such error
* messages.</p></td>
* </tr>
* <tr class="altColor">
* <td>scope</p></td>
* <td>false</p></td>
* <td>true</p></td>
* <td>The scope to use when exporting the result to a variable. This attribute
* is only used when var is also set. Possible values are page, request, session
* and application.</p></td>
* </tr>
* <tr class="rowColor">
* <td>text</p></td>
* <td>false</p></td>
* <td>true</p></td>
* <td>Default text to output when a message for the given code could not be
* found. If both text and code are not set, the tag will output null.</p></td>
* </tr>
* <tr class="altColor">
* <td>var</p></td>
* <td>false</p></td>
* <td>true</p></td>
* <td>The string to use when binding the result to the page, request, session
* or application scope. If not specified, the result gets outputted to the writer
* (i.e. typically directly to the JSP).</p></td>
* </tr>
* </tbody>
* </table>
*
* @author Rod Johnson
* @author Juergen Hoeller
* @author Nicholas Williams
Expand Down
Loading

0 comments on commit eea8ee2

Please sign in to comment.