Author: fschumacher Date: Sat Sep 12 16:07:52 2015 New Revision: 1702647 URL: http://svn.apache.org/r1702647 Log: Javadoc changes. Use {@code ...} instead of <tt>...</t>. That way < and > can be directly written as '<' and '>'. Use <pre> to keep the formatting of xml fragments and split a few lines to make the param-values clearer.
Modified: tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java Modified: tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java?rev=1702647&r1=1702646&r2=1702647&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java (original) +++ tomcat/trunk/java/org/apache/catalina/filters/ExpiresFilter.java Sat Sep 12 16:07:52 2015 @@ -48,18 +48,19 @@ import org.apache.juli.logging.LogFactor * <p> * ExpiresFilter is a Java Servlet API port of <a * href="http://httpd.apache.org/docs/2.2/mod/mod_expires.html">Apache - * mod_expires</a> to add ' <tt>Expires</tt>' and ' - * <tt>Cache-Control: max-age=</tt>' headers to HTTP response according to its ' - * <tt>Content-Type</tt>'. + * mod_expires</a> to add '{@code Expires}' and + * '{@code Cache-Control: max-age=}' headers to HTTP response according to its + * '{@code Content-Type}'. * </p> * * <p> - * Following documentation is inspired by <tt>mod_expires</tt> . + * Following documentation is inspired by <a + * href="http://httpd.apache.org/docs/2.2/mod/mod_expires.html">mod_expires</a> * </p> * <h1>Summary</h1> * <p> - * This filter controls the setting of the <tt>Expires</tt> HTTP header and the - * <tt>max-age</tt> directive of the <tt>Cache-Control</tt> HTTP header in + * This filter controls the setting of the {@code Expires} HTTP header and the + * {@code max-age} directive of the {@code Cache-Control} HTTP header in * server responses. The expiration date can set to be relative to either the * time the source file was last modified, or to the time of the client access. * </p> @@ -71,73 +72,74 @@ import org.apache.juli.logging.LogFactor * be obtained from the source. * </p> * <p> - * To modify <tt>Cache-Control</tt> directives other than <tt>max-age</tt> (see + * To modify {@code Cache-Control} directives other than {@code max-age} (see * <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9" >RFC * 2616 section 14.9</a>), you can use other servlet filters or <a * href="http://httpd.apache.org/docs/2.2/mod/mod_headers.html" >Apache Httpd * mod_headers</a> module. * </p> - * <h1>Filter Configuration</h1><h2>Basic configuration to add ' - * <tt>Expires</tt>' and ' <tt>Cache-Control: max-age=</tt>' + * <h1>Filter Configuration</h1><h2>Basic configuration to add + * '{@code Expires}' and '{@code Cache-Control: max-age=}' * headers to images, css and javascript</h2> * - * <code> - * <web-app ...> + * <pre> + * {@code + * <web-app ...> * ... - * <filter> - * <filter-name>ExpiresFilter</filter-name> - * <filter-class>org.apache.catalina.filters.ExpiresFilter</filter-class> - * <init-param> - * <param-name>ExpiresByType image</param-name> - * <param-value>access plus 10 minutes</param-value> - * </init-param> - * <init-param> - * <param-name>ExpiresByType text/css</param-name> - * <param-value>access plus 10 minutes</param-value> - * </init-param> - * <init-param> - * <param-name>ExpiresByType application/javascript</param-name> - * <param-value>access plus 10 minutes</param-value> - * </init-param> - * </filter> + * <filter> + * <filter-name>ExpiresFilter</filter-name> + * <filter-class>org.apache.catalina.filters.ExpiresFilter</filter-class> + * <init-param> + * <param-name>ExpiresByType image</param-name> + * <param-value>access plus 10 minutes</param-value> + * </init-param> + * <init-param> + * <param-name>ExpiresByType text/css</param-name> + * <param-value>access plus 10 minutes</param-value> + * </init-param> + * <init-param> + * <param-name>ExpiresByType application/javascript</param-name> + * <param-value>access plus 10 minutes</param-value> + * </init-param> + * </filter> * ... - * <filter-mapping> - * <filter-name>ExpiresFilter</filter-name> - * <url-pattern>/*</url-pattern> - * <dispatcher>REQUEST</dispatcher> - * </filter-mapping> + * <filter-mapping> + * <filter-name>ExpiresFilter</filter-name> + * <url-pattern>/*</url-pattern> + * <dispatcher>REQUEST</dispatcher> + * </filter-mapping> * ... - * </web-app> - * </code> + * </web-app> + * } + * </pre> * * <h2>Configuration Parameters</h2> * - * <h3> - * <tt>ExpiresByType <content-type></tt></h3> + * <h3>{@code ExpiresByType <content-type>}</h3> * <p> - * This directive defines the value of the <tt>Expires</tt> header and the - * <tt>max-age</tt> directive of the <tt>Cache-Control</tt> header generated for - * documents of the specified type (<i>e.g.</i>, <tt>text/html</tt>). The second + * This directive defines the value of the {@code Expires} header and the + * {@code max-age} directive of the {@code Cache-Control} header generated for + * documents of the specified type (<i>e.g.</i>, {@code text/html}). The second * argument sets the number of seconds that will be added to a base time to - * construct the expiration date. The <tt>Cache-Control: max-age</tt> is + * construct the expiration date. The {@code Cache-Control: max-age} is * calculated by subtracting the request time from the expiration date and * expressing the result in seconds. * </p> * <p> * The base time is either the last modification time of the file, or the time * of the client's access to the document. Which should be used is - * specified by the <tt><code></tt> field; <tt>M</tt> means that the + * specified by the {@code <code>} field; {@code M} means that the * file's last modification time should be used as the base time, and - * <tt>A</tt> means the client's access time should be used. The duration - * is expressed in seconds. <tt>A2592000</tt> stands for - * <tt>access plus 30 days</tt> in alternate syntax. + * {@code A} means the client's access time should be used. The duration + * is expressed in seconds. {@code A2592000} stands for + * {@code access plus 30 days} in alternate syntax. * </p> * <p> - * The difference in effect is subtle. If <tt>M</tt> (<tt>modification</tt> in + * The difference in effect is subtle. If {@code M} ({@code modification} in * alternate syntax) is used, all current copies of the document in all caches * will expire at the same time, which can be good for something like a weekly - * notice that's always found at the same URL. If <tt>A</tt> ( - * <tt>access</tt> or <tt>now</tt> in alternate syntax) is used, the date of + * notice that's always found at the same URL. If {@code A} ( + * {@code access} or {@code now} in alternate syntax) is used, the date of * expiration is different for each client; this can be good for image files * that don't change very often, particularly for a set of related * documents that all refer to the same images (<i>i.e.</i>, the images will be @@ -147,206 +149,226 @@ import org.apache.juli.logging.LogFactor * <strong>Example:</strong> * </p> * - * <code> - * <init-param> - * <param-name>ExpiresByType text/html</param-name><param-value>access plus 1 month 15 days 2 hours</param-value> - * </init-param> + * <pre> + * {@code + * <init-param> + * <param-name>ExpiresByType text/html</param-name> + * <param-value>access plus 1 month 15 days 2 hours</param-value> + * </init-param> * - * <init-param> - * <!-- 2592000 seconds = 30 days --> - * <param-name>ExpiresByType image/gif</param-name><param-value>A2592000</param-value> - * </init-param> - * </code> + * <init-param> + * <!-- 2592000 seconds = 30 days --> + * <param-name>ExpiresByType image/gif</param-name> + * <param-value>A2592000</param-value> + * </init-param> + * } + * </pre> * <p> - * Note that this directive only has effect if <tt>ExpiresActive On</tt> has + * Note that this directive only has effect if {@code ExpiresActive On} has * been specified. It overrides, for the specified MIME type <i>only</i>, any - * expiration date set by the <tt>ExpiresDefault</tt> directive. + * expiration date set by the {@code ExpiresDefault} directive. * </p> * <p> * You can also specify the expiration time calculation using an alternate * syntax, described earlier in this document. * </p> * <h3> - * <tt>ExpiresExcludedResponseStatusCodes</tt></h3> + * {@code ExpiresExcludedResponseStatusCodes}</h3> * <p> * This directive defines the http response status codes for which the - * <tt>ExpiresFilter</tt> will not generate expiration headers. By default, the - * <tt>304</tt> status code ("<tt>Not modified</tt>") is skipped. The + * {@code ExpiresFilter} will not generate expiration headers. By default, the + * {@code 304} status code ("{@code Not modified}") is skipped. The * value is a comma separated list of http status codes. * </p> * <p> - * This directive is useful to ease usage of <tt>ExpiresDefault</tt> directive. - * Indeed, the behavior of <tt>304 Not modified</tt> (which does specify a - * <tt>Content-Type</tt> header) combined with <tt>Expires</tt> and - * <tt>Cache-Control:max-age=</tt> headers can be unnecessarily tricky to + * This directive is useful to ease usage of {@code ExpiresDefault} directive. + * Indeed, the behavior of {@code 304 Not modified} (which does specify a + * {@code Content-Type} header) combined with {@code Expires} and + * {@code Cache-Control:max-age=} headers can be unnecessarily tricky to * understand. * </p> * <p> * Configuration sample : * </p> * - * <code> - * <init-param> - * <param-name>ExpiresExcludedResponseStatusCodes</param-name><param-value>302, 500, 503</param-value> - * </init-param> - * </code> + * <pre> + * {@code + * <init-param> + * <param-name>ExpiresExcludedResponseStatusCodes</param-name> + * <param-value>302, 500, 503</param-value> + * </init-param> + * } + * </pre> * * <h3>ExpiresDefault</h3> * <p> * This directive sets the default algorithm for calculating the expiration time * for all documents in the affected realm. It can be overridden on a - * type-by-type basis by the <tt>ExpiresByType</tt> directive. See the + * type-by-type basis by the {@code ExpiresByType} directive. See the * description of that directive for details about the syntax of the argument, * and the "alternate syntax" description as well. * </p> * <h1>Alternate Syntax</h1> * <p> - * The <tt>ExpiresDefault</tt> and <tt>ExpiresByType</tt> directives can also be + * The {@code ExpiresDefault} and {@code ExpiresByType} directives can also be * defined in a more readable syntax of the form: * </p> * - * <code> - * <init-param> - * <param-name>ExpiresDefault</param-name><param-value><base> [plus] {<num> <type>}*</param-value> - * </init-param> + * <pre> + * {@code + * <init-param> + * <param-name>ExpiresDefault</param-name> + * <param-value><base> [plus] {<num> <type>}*</param-value> + * </init-param> * - * <init-param> - * <param-name>ExpiresByType type/encoding</param-name><param-value><base> [plus] {<num> <type>}*</param-value> - * </init-param> - * </code> + * <init-param> + * <param-name>ExpiresByType type/encoding</param-name> + * <param-value><base> [plus] {<num> <type>}*</param-value> + * </init-param> + * } + * </pre> * <p> - * where <tt><base></tt> is one of: + * where {@code <base>} is one of: * </p> * <ul> - * <li><tt>access</tt></li> - * <li><tt>now</tt> (equivalent to '<tt>access</tt>')</li> - * <li><tt>modification</tt></li> + * <li>{@code access}</li> + * <li>{@code now} (equivalent to '{@code access}')</li> + * <li>{@code modification}</li> * </ul> * <p> - * The <tt>plus</tt> keyword is optional. <tt><num></tt> should be an - * integer value (acceptable to <tt>Integer.parseInt()</tt>), and - * <tt><type></tt> is one of: + * The {@code plus} keyword is optional. {@code <num>} should be an + * integer value (acceptable to {@code Integer.parseInt()}), and + * {@code <type>} is one of: * </p> * <ul> - * <li><tt>years</tt></li> - * <li><tt>months</tt></li> - * <li><tt>weeks</tt></li> - * <li><tt>days</tt></li> - * <li><tt>hours</tt></li> - * <li><tt>minutes</tt></li> - * <li><tt>seconds</tt></li> + * <li>{@code years}</li> + * <li>{@code months}</li> + * <li>{@code weeks}</li> + * <li>{@code days}</li> + * <li>{@code hours}</li> + * <li>{@code minutes}</li> + * <li>{@code seconds}</li> * </ul> * <p> * For example, any of the following directives can be used to make documents * expire 1 month after being accessed, by default: * </p> * - * <code> - * <init-param> - * <param-name>ExpiresDefault</param-name><param-value>access plus 1 month</param-value> - * </init-param> + * <pre> + * {@code + * <init-param> + * <param-name>ExpiresDefault</param-name> + * <param-value>access plus 1 month</param-value> + * </init-param> * - * <init-param> - * <param-name>ExpiresDefault</param-name><param-value>access plus 4 weeks</param-value> - * </init-param> + * <init-param> + * <param-name>ExpiresDefault</param-name> + * <param-value>access plus 4 weeks</param-value> + * </init-param> * - * <init-param> - * <param-name>ExpiresDefault</param-name><param-value>access plus 30 days</param-value> - * </init-param> - * </code> + * <init-param> + * <param-name>ExpiresDefault</param-name> + * <param-value>access plus 30 days</param-value> + * </init-param> + * } + * </pre> * <p> * The expiry time can be fine-tuned by adding several ' - * <tt><num> <type></tt>' clauses: + * {@code <num> <type>}' clauses: * </p> * - * <code> - * <init-param> - * <param-name>ExpiresByType text/html</param-name><param-value>access plus 1 month 15 days 2 hours</param-value> - * </init-param> + * <pre> + * {@code + * <init-param> + * <param-name>ExpiresByType text/html</param-name> + * <param-value>access plus 1 month 15 days 2 hours</param-value> + * </init-param> * - * <init-param> - * <param-name>ExpiresByType image/gif</param-name><param-value>modification plus 5 hours 3 minutes</param-value> - * </init-param> - * </code> + * <init-param> + * <param-name>ExpiresByType image/gif</param-name> + * <param-value>modification plus 5 hours 3 minutes</param-value> + * </init-param> + * } + * </pre> * <p> - * Note that if you use a modification date based setting, the <tt>Expires</tt> + * Note that if you use a modification date based setting, the {@code Expires} * header will <strong>not</strong> be added to content that does not come from * a file on disk. This is due to the fact that there is no modification time * for such content. * </p> * <h1>Expiration headers generation eligibility</h1> * <p> - * A response is eligible to be enriched by <tt>ExpiresFilter</tt> if : + * A response is eligible to be enriched by {@code ExpiresFilter} if : * </p> * <ol> - * <li>no expiration header is defined (<tt>Expires</tt> header or the - * <tt>max-age</tt> directive of the <tt>Cache-Control</tt> header),</li> + * <li>no expiration header is defined ({@code Expires} header or the + * {@code max-age} directive of the {@code Cache-Control} header),</li> * <li>the response status code is not excluded by the directive - * <tt>ExpiresExcludedResponseStatusCodes</tt>,</li> - * <li>the <tt>Content-Type</tt> of the response matches one of the types - * defined the in <tt>ExpiresByType</tt> directives or the - * <tt>ExpiresDefault</tt> directive is defined.</li> + * {@code ExpiresExcludedResponseStatusCodes},</li> + * <li>the {@code Content-Type} of the response matches one of the types + * defined the in {@code ExpiresByType} directives or the + * {@code ExpiresDefault} directive is defined.</li> * </ol> * <p> * Note : * </p> * <ul> - * <li>If <tt>Cache-Control</tt> header contains other directives than - * <tt>max-age</tt>, they are concatenated with the <tt>max-age</tt> directive - * that is added by the <tt>ExpiresFilter</tt>.</li> + * <li>If {@code Cache-Control} header contains other directives than + * {@code max-age}, they are concatenated with the {@code max-age} directive + * that is added by the {@code ExpiresFilter}.</li> * </ul> * <h1>Expiration configuration selection</h1> * <p> * The expiration configuration if elected according to the following algorithm: * </p> * <ol> - * <li><tt>ExpiresByType</tt> matching the exact content-type returned by - * <tt>HttpServletResponse.getContentType()</tt> possibly including the charset - * (e.g. '<tt>text/xml;charset=UTF-8</tt>'),</li> - * <li><tt>ExpiresByType</tt> matching the content-type without the charset if - * <tt>HttpServletResponse.getContentType()</tt> contains a charset (e.g. ' - * <tt>text/xml;charset=UTF-8</tt>' -> '<tt>text/xml</tt>'),</li> - * <li><tt>ExpiresByType</tt> matching the major type (e.g. substring before - * '<tt>/</tt>') of <tt>HttpServletResponse.getContentType()</tt> - * (e.g. '<tt>text/xml;charset=UTF-8</tt>' -> '<tt>text</tt> + * <li>{@code ExpiresByType} matching the exact content-type returned by + * {@code HttpServletResponse.getContentType()} possibly including the charset + * (e.g. '{@code text/xml;charset=UTF-8}'),</li> + * <li>{@code ExpiresByType} matching the content-type without the charset if + * {@code HttpServletResponse.getContentType()} contains a charset (e.g. ' + * {@code text/xml;charset=UTF-8}' -> '{@code text/xml}'),</li> + * <li>{@code ExpiresByType} matching the major type (e.g. substring before + * '{@code /}') of {@code HttpServletResponse.getContentType()} + * (e.g. '{@code text/xml;charset=UTF-8}' -> '{@code text} * '),</li> - * <li><tt>ExpiresDefault</tt></li> + * <li>{@code ExpiresDefault}</li> * </ol> * <h1>Implementation Details</h1><h2>When to write the expiration headers ?</h2> * <p> - * The <tt>ExpiresFilter</tt> traps the 'on before write response + * The {@code ExpiresFilter} traps the 'on before write response * body' event to decide whether it should generate expiration headers or * not. * </p> * <p> * To trap the 'before write response body' event, the - * <tt>ExpiresFilter</tt> wraps the http servlet response's writer and - * outputStream to intercept calls to the methods <tt>write()</tt>, - * <tt>print()</tt>, <tt>close()</tt> and <tt>flush()</tt>. For empty response - * body (e.g. empty files), the <tt>write()</tt>, <tt>print()</tt>, - * <tt>close()</tt> and <tt>flush()</tt> methods are not called; to handle this - * case, the <tt>ExpiresFilter</tt>, at the end of its <tt>doFilter()</tt> - * method, manually triggers the <tt>onBeforeWriteResponseBody()</tt> method. + * {@code ExpiresFilter} wraps the http servlet response's writer and + * outputStream to intercept calls to the methods {@code write()}, + * {@code print()}, {@code close()} and {@code flush()}. For empty response + * body (e.g. empty files), the {@code write()}, {@code print()}, + * {@code close()} and {@code flush()} methods are not called; to handle this + * case, the {@code ExpiresFilter}, at the end of its {@code doFilter()} + * method, manually triggers the {@code onBeforeWriteResponseBody()} method. * </p> * <h2>Configuration syntax</h2> * <p> - * The <tt>ExpiresFilter</tt> supports the same configuration syntax as Apache + * The {@code ExpiresFilter} supports the same configuration syntax as Apache * Httpd mod_expires. * </p> * <p> - * A challenge has been to choose the name of the <tt><param-name></tt> - * associated with <tt>ExpiresByType</tt> in the <tt><filter></tt> - * declaration. Indeed, Several <tt>ExpiresByType</tt> directives can be - * declared when <tt>web.xml</tt> syntax does not allow to declare several - * <tt><init-param></tt> with the same name. + * A challenge has been to choose the name of the {@code <param-name>} + * associated with {@code ExpiresByType} in the {@code <filter>} + * declaration. Indeed, Several {@code ExpiresByType} directives can be + * declared when {@code web.xml} syntax does not allow to declare several + * {@code <init-param>} with the same name. * </p> * <p> * The workaround has been to declare the content type in the - * <tt><param-name></tt> rather than in the <tt><param-value></tt>. + * {@code <param-name>} rather than in the {@code <param-value>}. * </p> * <h2>Designed for extension : the open/close principle</h2> * <p> - * The <tt>ExpiresFilter</tt> has been designed for extension following the + * The {@code ExpiresFilter} has been designed for extension following the * open/close principle. * </p> * <p> @@ -362,7 +384,7 @@ import org.apache.juli.logging.LogFactor * <h1>Troubleshooting</h1> * <p> * To troubleshoot, enable logging on the - * <tt>org.apache.catalina.filters.ExpiresFilter</tt>. + * {@code org.apache.catalina.filters.ExpiresFilter}. * </p> * <p> * Extract of logging.properties @@ -386,7 +408,7 @@ import org.apache.juli.logging.LogFactor * application/javascript=ExpiresConfiguration[startingPoint=ACCESS_TIME, duration=[10 MINUTE]]}] * </code> * <p> - * Sample of per-request log message where <tt>ExpiresFilter</tt> adds an + * Sample of per-request log message where {@code ExpiresFilter} adds an * expiration date * </p> * @@ -395,7 +417,7 @@ import org.apache.juli.logging.LogFactor * FINE: Request "/tomcat.gif" with response status "200" content-type "image/gif", set expiration date 3/26/10 2:19 PM * </code> * <p> - * Sample of per-request log message where <tt>ExpiresFilter</tt> does not add + * Sample of per-request log message where {@code ExpiresFilter} does not add * an expiration date * </p> * @@ -459,7 +481,7 @@ public class ExpiresFilter extends Filte * Main piece of configuration of the filter. * </p> * <p> - * Can be expressed like '<tt>access plus 1 month 15 days 2 hours</tt>'. + * Can be expressed like '{@code access plus 1 month 15 days 2 hours}'. * </p> */ protected static class ExpiresConfiguration { @@ -513,20 +535,20 @@ public class ExpiresFilter extends Filte * <p> * For performance optimization : this extended response holds the * {@link #lastModifiedHeader} and {@link #cacheControlHeader} values access - * to the slow {@link #getHeader(String)} and to spare the <tt>string</tt> - * to <tt>date</tt> to <tt>long</tt> conversion. + * to the slow {@link #getHeader(String)} and to spare the {@code string} + * to {@code date} to {@code long} conversion. * </p> */ public class XHttpServletResponse extends HttpServletResponseWrapper { /** - * Value of the <tt>Cache-Control/tt> http response header if it has + * Value of the {@code Cache-Control} http response header if it has * been set. */ private String cacheControlHeader; /** - * Value of the <tt>Last-Modified</tt> http response header if it has + * Value of the {@code Last-Modified} http response header if it has * been set. */ private long lastModifiedHeader; @@ -540,8 +562,8 @@ public class ExpiresFilter extends Filte private ServletOutputStream servletOutputStream; /** - * Indicates whether calls to write methods (<tt>write(...)</tt>, - * <tt>print(...)</tt>, etc) of the response body have been called or + * Indicates whether calls to write methods ({@code write(...)}, + * {@code print(...)}, etc) of the response body have been called or * not. */ private boolean writeResponseBodyStarted; @@ -1037,11 +1059,11 @@ public class ExpiresFilter extends Filte private static final String PARAMETER_EXPIRES_EXCLUDED_RESPONSE_STATUS_CODES = "ExpiresExcludedResponseStatusCodes"; /** - * Convert a comma delimited list of numbers into an <tt>int[]</tt>. + * Convert a comma delimited list of numbers into an {@code int[]}. * * @param commaDelimitedInts - * can be <code>null</code> - * @return never <code>null</code> array + * can be {@code null} + * @return never {@code null} array */ protected static int[] commaDelimitedListToIntArray( String commaDelimitedInts) { @@ -1063,7 +1085,7 @@ public class ExpiresFilter extends Filte /** * Convert a given comma delimited list of strings into an array of String * - * @return array of patterns (non <code>null</code>) + * @return array of patterns (non {@code null}) */ protected static String[] commaDelimitedListToStringArray( String commaDelimitedStrings) { @@ -1072,8 +1094,8 @@ public class ExpiresFilter extends Filte } /** - * Return <code>true</code> if the given <code>str</code> contains the given - * <code>searchStr</code>. + * Return {@code true} if the given {@code str} contains the given + * {@code searchStr}. */ protected static boolean contains(String str, String searchStr) { if (str == null || searchStr == null) { @@ -1102,15 +1124,15 @@ public class ExpiresFilter extends Filte } /** - * Return <code>true</code> if the given <code>str</code> is - * <code>null</code> or has a zero characters length. + * Return {@code true} if the given {@code str} is + * {@code null} or has a zero characters length. */ protected static boolean isEmpty(String str) { return str == null || str.length() == 0; } /** - * Return <code>true</code> if the given <code>str</code> has at least one + * Return {@code true} if the given {@code str} has at least one * character (can be a withespace). */ protected static boolean isNotEmpty(String str) { @@ -1118,13 +1140,13 @@ public class ExpiresFilter extends Filte } /** - * Return <code>true</code> if the given <code>string</code> starts with the - * given <code>prefix</code> ignoring case. + * Return {@code true} if the given {@code string} starts with the + * given {@code prefix} ignoring case. * * @param string - * can be <code>null</code> + * can be {@code null} * @param prefix - * can be <code>null</code> + * can be {@code null} */ protected static boolean startsWithIgnoreCase(String string, String prefix) { if (string == null || prefix == null) { @@ -1138,15 +1160,15 @@ public class ExpiresFilter extends Filte } /** - * Return the subset of the given <code>str</code> that is before the first - * occurence of the given <code>separator</code>. Return <code>null</code> - * if the given <code>str</code> or the given <code>separator</code> is - * null. Return and empty string if the <code>separator</code> is empty. + * Return the subset of the given {@code str} that is before the first + * occurence of the given {@code separator}. Return {@code null} + * if the given {@code str} or the given {@code separator} is + * null. Return and empty string if the {@code separator} is empty. * * @param str - * can be <code>null</code> + * can be {@code null} * @param separator - * can be <code>null</code> + * can be {@code null} */ protected static String substringBefore(String str, String separator) { if (str == null || str.isEmpty() || separator == null) { @@ -1225,11 +1247,11 @@ public class ExpiresFilter extends Filte /** * <p> * Returns the expiration date of the given {@link XHttpServletResponse} or - * <code>null</code> if no expiration date has been configured for the + * {@code null} if no expiration date has been configured for the * declared content type. * </p> * <p> - * <code>protected</code> for extension. + * {@code protected} for extension. * </p> * * @see HttpServletResponse#getContentType() @@ -1306,7 +1328,7 @@ public class ExpiresFilter extends Filte * {@link HttpServletRequest} and {@link XHttpServletResponse}. * </p> * <p> - * <code>protected</code> for extension. + * {@code protected} for extension. * </p> */ protected Date getExpirationDate(ExpiresConfiguration configuration, @@ -1390,7 +1412,7 @@ public class ExpiresFilter extends Filte /** * * <p> - * <code>protected</code> for extension. + * {@code protected} for extension. * </p> */ protected boolean isEligibleToExpirationHeaderGeneration( @@ -1426,18 +1448,18 @@ public class ExpiresFilter extends Filte /** * <p> * If no expiration header has been set by the servlet and an expiration has - * been defined in the {@link ExpiresFilter} configuration, sets the ' - * <tt>Expires</tt>' header and the attribute '<tt>max-age</tt>' of the ' - * <tt>Cache-Control</tt>' header. + * been defined in the {@link ExpiresFilter} configuration, sets the + * '{@code Expires}' header and the attribute '{@code max-age}' of the + * '{@code Cache-Control}' header. * </p> * <p> * Must be called on the "Start Write Response Body" event. * </p> * <p> - * Invocations to <tt>Logger.debug(...)</tt> are guarded by + * Invocations to {@code Logger.debug(...)} are guarded by * {@link Log#isDebugEnabled()} because * {@link HttpServletRequest#getRequestURI()} and - * {@link HttpServletResponse#getContentType()} costs <tt>String</tt> + * {@link HttpServletResponse#getContentType()} costs {@code String} * objects instantiations (as of Tomcat 7). * </p> */ @@ -1477,9 +1499,9 @@ public class ExpiresFilter extends Filte } /** - * Parse configuration lines like ' - * <tt>access plus 1 month 15 days 2 hours</tt>' or ' - * <tt>modification 1 day 2 hours 5 seconds</tt>' + * Parse configuration lines like + * '{@code access plus 1 month 15 days 2 hours}' or + * '{@code modification 1 day 2 hours 5 seconds}' * * @param inputLine */ --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org