<%-- WARNING: This is strictly a JSP include file which contains method and field declarations. It cannot be executed on its own. --%> <%-- htmlescape.jsp Written August 2005 by Chris Schultz Contains a method, "getHeaderSection", that accepts a String HTTP header name and returns a String that points to an anchor reference in the document http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html In order to use this as an include file, you'll need to import java.util.Map and java.util.HashMap into the enclosing JSP. --%> <%! // // Table for looking-up request header names and resolving them // to their HTTP request header section numbers. // // This list was created using the following command on the file // retrieved from http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html // // grep "//" \ // -e "s/<.*//" \ // -e "s/^/\{\"/" \ // -e "s/ /\", \"/" \ // -e "s/$/\"\},/" \ // -e "s/^/ /" // // Sure, there's some extra stuff in there, but it doesn't matter a whole // lot. // private static String[][] sectionNames = { {"sec14", "Header Field Definitions"}, {"sec14.1", "Accept"}, {"sec14.2", "Accept-Charset"}, {"sec14.3", "Accept-Encoding"}, {"sec14.4", "Accept-Language"}, {"sec14.5", "Accept-Ranges"}, {"sec14.6", "Age"}, {"sec14.7", "Allow"}, {"sec14.8", "Authorization"}, {"sec14.9", "Cache-Control"}, {"sec14.9.1", "What is Cacheable"}, {"sec14.9.2", "What May be Stored by Caches"}, {"sec14.9.3", "Modifications of the Basic Expiration Mechanism"}, {"sec14.9.4", "Cache Revalidation and Reload Controls"}, {"sec14.9.5", "No-Transform Directive"}, {"sec14.9.6", "Cache Control Extensions"}, {"sec14.10", "Connection"}, {"sec14.11", "Content-Encoding"}, {"sec14.12", "Content-Language"}, {"sec14.13", "Content-Length"}, {"sec14.14", "Content-Location"}, {"sec14.15", "Content-MD5"}, {"sec14.16", "Content-Range"}, {"sec14.17", "Content-Type"}, {"sec14.18", "Date"}, {"sec14.18.1", "Clockless Origin Server Operation"}, {"sec14.19", "ETag"}, {"sec14.20", "Expect"}, {"sec14.21", "Expires"}, {"sec14.22", "From"}, {"sec14.23", "Host"}, {"sec14.24", "If-Match"}, {"sec14.25", "If-Modified-Since"}, {"sec14.26", "If-None-Match"}, {"sec14.27", "If-Range"}, {"sec14.28", "If-Unmodified-Since"}, {"sec14.29", "Last-Modified"}, {"sec14.30", "Location"}, {"sec14.31", "Max-Forwards"}, {"sec14.32", "Pragma"}, {"sec14.33", "Proxy-Authenticate"}, {"sec14.34", "Proxy-Authorization"}, {"sec14.35", "Range"}, {"sec14.35.1", "Byte Ranges"}, {"sec14.35.2", "Range Retrieval Requests"}, {"sec14.36", "Referer"}, {"sec14.37", "Retry-After"}, {"sec14.38", "Server"}, {"sec14.39", "TE"}, {"sec14.40", "Trailer"}, {"sec14.41", "Transfer-Encoding"}, {"sec14.42", "Upgrade"}, {"sec14.43", "User-Agent"}, {"sec14.44", "Vary"}, {"sec14.45", "Via"}, {"sec14.46", "Warning"}, {"sec14.47", "WWW-Authenticate"} }; static Map header2sec = new HashMap(); static { for(int i=0; i