<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<!-- saved from url=(0014)about:internet --> | |
<HTML> | |
<HEAD> | |
<!-- Generated by javadoc (build 1.5.0_19) on Sun Mar 20 20:56:38 PKT 2011 --> | |
<META http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<TITLE> | |
PerformanceFilter (Click Extras API - v2.3.0) | |
</TITLE> | |
<META NAME="keywords" CONTENT="org.apache.click.extras.filter.PerformanceFilter class"> | |
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> | |
<SCRIPT type="text/javascript"> | |
function windowTitle() | |
{ | |
parent.document.title="PerformanceFilter (Click Extras API - v2.3.0)"; | |
} | |
</SCRIPT> | |
<NOSCRIPT> | |
</NOSCRIPT> | |
</HEAD> | |
<BODY BGCOLOR="white"> | |
<!-- ========= START OF TOP NAVBAR ======= --> | |
<A NAME="navbar_top"><!-- --></A> | |
<A HREF="#skip-navbar_top" title="Skip navigation links"></A> | |
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> | |
<TR> | |
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> | |
<A NAME="navbar_top_firstrow"><!-- --></A> | |
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> | |
<TR ALIGN="center" VALIGN="top"> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> | |
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> | |
</TR> | |
</TABLE> | |
</TD> | |
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> | |
</EM> | |
</TD> | |
</TR> | |
<TR> | |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> | |
<A HREF="../../../../../org/apache/click/extras/filter/CompressionServletResponseWrapper.html" title="class in org.apache.click.extras.filter"><B>PREV CLASS</B></A> | |
NEXT CLASS</FONT></TD> | |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> | |
<A HREF="../../../../../index.html?org/apache/click/extras/filter/PerformanceFilter.html" target="_top"><B>FRAMES</B></A> | |
<A HREF="PerformanceFilter.html" target="_top"><B>NO FRAMES</B></A> | |
<SCRIPT type="text/javascript"> | |
<!-- | |
if(window==top) { | |
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); | |
} | |
//--> | |
</SCRIPT> | |
<NOSCRIPT> | |
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> | |
</NOSCRIPT> | |
</FONT></TD> | |
</TR> | |
<TR> | |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> | |
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> | |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> | |
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> | |
</TR> | |
</TABLE> | |
<A NAME="skip-navbar_top"></A> | |
<!-- ========= END OF TOP NAVBAR ========= --> | |
<HR> | |
<!-- ======== START OF CLASS DATA ======== --> | |
<H2> | |
<FONT SIZE="-1"> | |
org.apache.click.extras.filter</FONT> | |
<BR> | |
Class PerformanceFilter</H2> | |
<PRE> | |
<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</A> | |
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.click.extras.filter.PerformanceFilter</B> | |
</PRE> | |
<DL> | |
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/Filter.html" title="class or interface in javax.servlet">Filter</A></DD> | |
</DL> | |
<HR> | |
<DL> | |
<DT><PRE>public class <B>PerformanceFilter</B><DT>extends <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A><DT>implements <A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/Filter.html" title="class or interface in javax.servlet">Filter</A></DL> | |
</PRE> | |
<P> | |
Provides a filter for improving the performance of web applications by | |
setting Expires header on static resources and by compressing the HTTP | |
response. | |
<p/> | |
Please see Yahoo's <a href="http://developer.yahoo.com/performance/rules.html">Exceptional Performance</a> | |
best practices for speeding up your web site. This filter will enable you to | |
apply the rules: | |
<ul> | |
<li><a class="external" target="_blank" href="http://developer.yahoo.com/performance/rules.html#expires">Add an Expires Header</a></li> | |
<li><a class="external" target="_blank" href="http://developer.yahoo.com/performance/rules.html#gzip">Gzip Components</a></li> | |
</ul> | |
Apache Click can also help you with the following rules: | |
<ul> | |
<li><a class="external" target="_blank" href="http://developer.yahoo.com/performance/rules.html#css_top">Put Stylesheets at the Top</a>, | |
by using $headElements at the top of your page</li> | |
<li><a class="external" target="_blank" href="http://developer.yahoo.com/performance/rules.html#js_bottom">Put Scripts at the Bottom</a>, | |
by using $jsElements at the bottom of your page</li> | |
<li><a class="external" target="_blank" href="http://developer.yahoo.com/performance/rules.html#js-dupes">Remove Duplicate Scripts</a> | |
- <A HREF="http://click.apache.org/docs/click-api/org/apache/click/Control.html#getHeadElements()" title="class or interface in org.apache.click"><CODE>Control.getHeadElements()</CODE></A> automatically | |
removes duplicate scripts.</li> | |
</ul> | |
<h3>Click Static Resources</h3> | |
This filter will automatically add long expiry headers (5 years) to static Click | |
resources such as CSS style sheets imports, JavaScript imports, and images. | |
This will ensure these resources are cached in the users browser and will not | |
have to be requested again. With Click, static resources are automatically | |
deployed on startup to the web directory <tt style="color:blue;">/click</tt>. | |
<p/> | |
When the PerformanceFilter is active Click will add a <tt>version</tt> number | |
to the static resource filenames and the long expiry header will be applied to | |
these versioned files. When you upgrade the the next version of Click, this | |
version number will increment, and the new static resources will be requested | |
again and cached by the users browser. | |
<p/> | |
When the PerformanceFilter is not active Click will not include a version | |
number in the static resource filenames and no expiry header will be applied. | |
<p/> | |
The filter will always GZIP compress non image, static Click resources, such as | |
style sheets and JavaScript imports. | |
<h3>Configured Static Resources</h3> | |
You can also configure your application's static resources such as CSS, JS | |
files and images to be processed by the filter. | |
<p/> | |
This filter will automatically add long expiry headers to configured | |
resources. The default expiry header is 1 year, but can be changed through | |
the <tt>init-param</tt> <span class="blue">"cacheable-max-age"</span>. | |
This ensures the resources are cached in the users browser and will not | |
have to be requested again. | |
<p/> | |
The PerformanceFilter provides the ability to add <tt>versioning</tt> | |
to application specific resources through the | |
<tt>init-param</tt> <span class="blue">"application-version"</span>. For example | |
to set the <span class="blue">"application-version"</span> to <span class="red">1.0</span> | |
you can define the filter as follows: | |
<pre class="codeConfig"> | |
<filter> | |
<filter-name><span class="blue">PerformanceFilter</span></filter-name> | |
<filter-class><span class="red">org.apache.click.extras.filter.PerformanceFilter</span></filter-class> | |
<init-param> | |
<param-name><font color="blue">application-version</font></param-name> | |
<param-value><font color="red">1.0</font></param-value> | |
</init-param> | |
</filter> </pre> | |
Application versioning is supported by <A HREF="http://click.apache.org/docs/click-api/org/apache/click/element/ResourceElement.html" title="class or interface in org.apache.click.element"><CODE>resource elements</CODE></A> | |
such as <A HREF="http://click.apache.org/docs/click-api/org/apache/click/element/JsImport.html" title="class or interface in org.apache.click.element"><CODE>JsImport</CODE></A> and | |
<A HREF="http://click.apache.org/docs/click-api/org/apache/click/element/CssImport.html" title="class or interface in org.apache.click.element"><CODE>CssImport</CODE></A>. When the | |
<tt>application version</tt> is set, <A HREF="http://click.apache.org/docs/click-api/org/apache/click/element/ResourceElement.html" title="class or interface in org.apache.click.element"><CODE>ResourceElements</CODE></A> | |
will add the <tt>application version</tt> number to their filenames | |
and PerformanceFilter will apply the long expiry header to these versioned files. | |
When you increment the <tt>application version</tt>, the resource path will | |
change and the static resources will be requested again and cached by the | |
browser. | |
<p/> | |
PerformanceFilter provides GZIP compression to compress HTML ServletResponse | |
content. The content will only be compressed if it is bigger than a | |
configurable threshold. The default threshold is 384 bytes but can be changed | |
through the <tt>init-param</tt> <span class="blue">"compression-threshold"</span>. | |
<p/> | |
Click *.htm pages are automatically compressed by the filter. | |
<p/> | |
It is also possible to disable GZIP compression by setting the | |
<tt>init-param</tt> <span class="blue">"compression-enabled"</span> to false. | |
<h3>Page Template Import References</h3> | |
To import static control references in your page template you simply reference | |
the <tt class="blue">$headElements</tt> and <tt class="blue">$jsElements</tt>. | |
For example: | |
<pre class="codeHtml"> | |
<html> | |
<head> | |
<span class="blue">$headElements</span> | |
</head> | |
<body> | |
<span class="red">$table</span> | |
</body> | |
</html> | |
<span class="blue">$jsElements</span></pre> | |
HEAD elements should be included in the head section of your page, and | |
JavaScript elements should be included at the bottom of your page to support | |
progressive rendering in the browser. | |
<h3>Configuration</h3> | |
To configure your application to use the PerformanceFilter include the | |
click-extras.jar in your application and add the following filter elements to | |
your <tt>/WEB-INF/web.xml</tt> file: | |
<pre class="codeConfig"> | |
<filter> | |
<filter-name><span class="blue">PerformanceFilter</span></filter-name> | |
<filter-class><span class="red">org.apache.click.extras.filter.PerformanceFilter</span></filter-class> | |
<init-param> | |
<param-name><font color="blue">cacheable-paths</font></param-name> | |
<param-value><font color="red">/assets/*</font>, <font color="red">*.css</font></param-value> | |
</init-param> | |
</filter> | |
<filter-mapping> | |
<filter-name><span class="blue">PerformanceFilter</span></filter-name> | |
<url-pattern><span class="green">*.css</span></url-pattern> | |
</filter-mapping> | |
<filter-mapping> | |
<filter-name><span class="blue">PerformanceFilter</span></filter-name> | |
<url-pattern><span class="green">*.js</span></url-pattern> | |
</filter-mapping> | |
<filter-mapping> | |
<filter-name><span class="blue">PerformanceFilter</span></filter-name> | |
<url-pattern><span class="green">*.gif</span></url-pattern> | |
</filter-mapping> | |
<filter-mapping> | |
<filter-name><span class="blue">PerformanceFilter</span></filter-name> | |
<url-pattern><span class="green">*.png</span></url-pattern> | |
</filter-mapping> | |
<filter-mapping> | |
<filter-name><span class="blue">PerformanceFilter</span></filter-name> | |
<servlet-name><span class="green">ClickServlet</span></servlet-name> | |
</filter-mapping> | |
<servlet> | |
<servlet-name><span class="green">ClickServlet</span></servlet-name> | |
.. </pre> | |
The <tt>init-param</tt> <span class="blue">"cacheable-paths"</span>, allows | |
you to specify paths for resources such as JavaScript, CSS and images to be | |
<tt>cached</tt> by the browser. (Caching here means setting the | |
"Expires" and "Cache-Control" headers). The <tt>param-value</tt> accepts a | |
comma separated list of directories and files to match against. | |
To differentiate between directory and file values the following convention | |
is used: | |
<ul> | |
<li>To specify a directory, the value must <b>end</b> with the asterisk | |
character (*). When a resource is requested, the filter will only cache | |
the resource if the resource path starts with the specified value. For example | |
if the specified value is <tt><param-value><span class="red">/assets/*</span></param-value></tt>, | |
the resource <tt>"<span class="red">/assets/</span>library.js"</tt> will be | |
cached while <tt>"/public/library.js"</tt> will not be. | |
</li> | |
<li>To specify a file, the value must <b>start</b> with the asterisk character | |
(*). When a resource is requested, the filter will only cache the resource | |
if the resource path ends with the specified value. For example if the specified | |
value is <tt><param-value><span class="red">*.css</span></param-value></tt>, | |
the resource <tt>"/public/table<span class="red">.css</span>"</tt> will be | |
cached while <tt>"/public/table.js"</tt> will not be. | |
</li> | |
</ul> | |
This filter will automatically set the configured click.xml charset as the | |
requests character encoding. | |
<h3>Frequently Asked Questions</h3> | |
<h4>How does compression work?</h4> | |
The response from non image (gif, jpg, png) content will be gzipped before | |
writing to the browser. The browser will receive the gzipped content, unzip it, | |
and display the content in its original form. | |
<p/> | |
As the GZIP compression greatly reduces the size of HTML, CSS and JavaScript | |
content these resources are downloaded faster and displayed quicker in the | |
users browser. | |
<p/> | |
GZIP compression is only applied if the browser supports it, and if the size | |
of the content is greater than 384 bytes. | |
<h4>How does caching work?</h4> | |
For an explanation of how browsers and caching work, you can read the | |
following | |
<a href="http://betterexplained.com/articles/how-to-optimize-your-site-with-http-caching/" action="_blank">article.</a> | |
<p/> | |
Only configured resources (see below) will have expiry headers added. The | |
browser will not contact the server until the specified expiry date. When the | |
resource expires, the browser will request a new copy from the server. | |
<h4>Does PerformanceFilter work in development, debug or trace modes?</h4> | |
PerformanceFilter is only applied in <tt>production</tt> and <tt>profile</tt> | |
modes. In the development modes, this filter will simply pass through to | |
ClickServlet without adding expiry headers or compressing content. | |
<p/> | |
This ensures a smoother development experience. There is not need to worry | |
about server and browser resources getting out of sync. In development mode, | |
simply edit a javascript or style sheet and the browser will pick up the | |
latest version. | |
<h3>Acknowledgments</h3> | |
This class is adapted from the Jakarta CompressionFilter from | |
<a href="http://jakarta.apache.org/tomcat">Tomcat</a>. | |
<P> | |
<P> | |
<HR> | |
<P> | |
<!-- =========== FIELD SUMMARY =========== --> | |
<A NAME="field_summary"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> | |
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> | |
<B>Field Summary</B></FONT></TH> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#applicationVersionIndicator">applicationVersionIndicator</A></B></CODE> | |
<BR> | |
The application resource version indicator.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected long</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#cacheMaxAge">cacheMaxAge</A></B></CODE> | |
<BR> | |
The configured cache max age in seconds, default value is 1 year.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected boolean</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#compressionEnabled">compressionEnabled</A></B></CODE> | |
<BR> | |
Indicates if compression is enabled or not, default value is true.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected int</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#compressionThreshold">compressionThreshold</A></B></CODE> | |
<BR> | |
The threshold number to compress, default value is 384 bytes.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected <A HREF="http://click.apache.org/docs/click-api/org/apache/click/service/ConfigService.html" title="class or interface in org.apache.click.service">ConfigService</A></CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#configService">configService</A></B></CODE> | |
<BR> | |
The application configuration service.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected boolean</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#configured">configured</A></B></CODE> | |
<BR> | |
The filter has been configured flag.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected static int</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#DEFAULT_CACHE_MAX_AGE">DEFAULT_CACHE_MAX_AGE</A></B></CODE> | |
<BR> | |
Default cache max-age in seconds (1 year): 31536000.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>></CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#excludeDirs">excludeDirs</A></B></CODE> | |
<BR> | |
The cacheable-path exclude directories.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>></CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#excludeFiles">excludeFiles</A></B></CODE> | |
<BR> | |
The cacheable-path exclude files.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected <A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/FilterConfig.html" title="class or interface in javax.servlet">FilterConfig</A></CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#filterConfig">filterConfig</A></B></CODE> | |
<BR> | |
The filter configuration object we are associated with.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected static int</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#FOREVER_CACHE_MAX_AGE">FOREVER_CACHE_MAX_AGE</A></B></CODE> | |
<BR> | |
Forever cache max-age in seconds (5 years).</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>></CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#includeDirs">includeDirs</A></B></CODE> | |
<BR> | |
The cacheable-path include directories.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>></CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#includeFiles">includeFiles</A></B></CODE> | |
<BR> | |
The cacheable-path include files.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected static int</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#MIN_COMPRESSION_THRESHOLD">MIN_COMPRESSION_THRESHOLD</A></B></CODE> | |
<BR> | |
Minimum compress threshold: 384 bytes.</TD> | |
</TR> | |
</TABLE> | |
| |
<!-- ======== CONSTRUCTOR SUMMARY ======== --> | |
<A NAME="constructor_summary"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> | |
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> | |
<B>Constructor Summary</B></FONT></TH> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#PerformanceFilter()">PerformanceFilter</A></B>()</CODE> | |
<BR> | |
</TD> | |
</TR> | |
</TABLE> | |
| |
<!-- ========== METHOD SUMMARY =========== --> | |
<A NAME="method_summary"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> | |
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> | |
<B>Method Summary</B></FONT></TH> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> void</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#destroy()">destroy</A></B>()</CODE> | |
<BR> | |
Take this filter out of service.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> void</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)">doFilter</A></B>(<A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletRequest.html" title="class or interface in javax.servlet">ServletRequest</A> servletRequest, | |
<A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletResponse.html" title="class or interface in javax.servlet">ServletResponse</A> servletResponse, | |
<A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/FilterChain.html" title="class or interface in javax.servlet">FilterChain</A> chain)</CODE> | |
<BR> | |
Perform the filter operation applying any necessary Expire headers and | |
compressing the response content.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#getApplicationResourceVersionIndicator(java.lang.String)">getApplicationResourceVersionIndicator</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> path)</CODE> | |
<BR> | |
Return the application <tt>version indicator</tt> for the specified path.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected <A HREF="http://click.apache.org/docs/click-api/org/apache/click/service/ConfigService.html" title="class or interface in org.apache.click.service">ConfigService</A></CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#getConfigService()">getConfigService</A></B>()</CODE> | |
<BR> | |
Return the application configuration service.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> <A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/FilterConfig.html" title="class or interface in javax.servlet">FilterConfig</A></CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#getFilterConfig()">getFilterConfig</A></B>()</CODE> | |
<BR> | |
Return filter config.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#getResourceVersionIndicator(java.lang.String)">getResourceVersionIndicator</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> path)</CODE> | |
<BR> | |
Return the <tt>version indicator</tt> for the specified path.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> void</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#init(javax.servlet.FilterConfig)">init</A></B>(<A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/FilterConfig.html" title="class or interface in javax.servlet">FilterConfig</A> filterConfig)</CODE> | |
<BR> | |
Initialize the filter.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected boolean</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#isExcludePath(java.lang.String)">isExcludePath</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> path)</CODE> | |
<BR> | |
Return true if a path should be excluded from the performance filter.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected void</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#loadConfiguration()">loadConfiguration</A></B>()</CODE> | |
<BR> | |
Load the filters configuration and set the configured flat to true.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE> void</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#setFilterConfig(javax.servlet.FilterConfig)">setFilterConfig</A></B>(<A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/FilterConfig.html" title="class or interface in javax.servlet">FilterConfig</A> filterConfig)</CODE> | |
<BR> | |
Set filter configuration.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected void</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#setHeaderExpiresCache(javax.servlet.http.HttpServletResponse, long)">setHeaderExpiresCache</A></B>(<A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpServletResponse.html" title="class or interface in javax.servlet.http">HttpServletResponse</A> response, | |
long maxAgeSeconds)</CODE> | |
<BR> | |
Set the response "Expires" and "Cache-Control" headers with the given | |
maximum cache duration age in seconds.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A></CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#stripResourceVersionIndicator(java.lang.String)">stripResourceVersionIndicator</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> path)</CODE> | |
<BR> | |
Removes the version indicator from the specified path.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected boolean</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#useConfiguredCacheHeader(java.lang.String)">useConfiguredCacheHeader</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> path)</CODE> | |
<BR> | |
Return true if the response should be cached using the configured cache | |
max-age.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected boolean</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#useForeverCacheHeader(java.lang.String)">useForeverCacheHeader</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> path)</CODE> | |
<BR> | |
Return true if a path is a static versioned resource and should be | |
cached forever.</TD> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> | |
<CODE>protected boolean</CODE></FONT></TD> | |
<TD><CODE><B><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#useGzipCompression(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String)">useGzipCompression</A></B>(<A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpServletRequest.html" title="class or interface in javax.servlet.http">HttpServletRequest</A> request, | |
<A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpServletResponse.html" title="class or interface in javax.servlet.http">HttpServletResponse</A> response, | |
<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> path)</CODE> | |
<BR> | |
Return true if the response should be GZIP compressed.</TD> | |
</TR> | |
</TABLE> | |
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> | |
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TH> | |
</TR> | |
<TR BGCOLOR="white" CLASS="TableRowColor"> | |
<TD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> | |
</TR> | |
</TABLE> | |
| |
<P> | |
<!-- ============ FIELD DETAIL =========== --> | |
<A NAME="field_detail"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> | |
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> | |
<B>Field Detail</B></FONT></TH> | |
</TR> | |
</TABLE> | |
<A NAME="DEFAULT_CACHE_MAX_AGE"><!-- --></A><H3> | |
DEFAULT_CACHE_MAX_AGE</H3> | |
<PRE> | |
protected static final int <B>DEFAULT_CACHE_MAX_AGE</B></PRE> | |
<DL> | |
<DD>Default cache max-age in seconds (1 year): 31536000. | |
<P> | |
<DL> | |
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.click.extras.filter.PerformanceFilter.DEFAULT_CACHE_MAX_AGE">Constant Field Values</A></DL> | |
</DL> | |
<HR> | |
<A NAME="FOREVER_CACHE_MAX_AGE"><!-- --></A><H3> | |
FOREVER_CACHE_MAX_AGE</H3> | |
<PRE> | |
protected static final int <B>FOREVER_CACHE_MAX_AGE</B></PRE> | |
<DL> | |
<DD>Forever cache max-age in seconds (5 years). | |
<P> | |
<DL> | |
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.click.extras.filter.PerformanceFilter.FOREVER_CACHE_MAX_AGE">Constant Field Values</A></DL> | |
</DL> | |
<HR> | |
<A NAME="MIN_COMPRESSION_THRESHOLD"><!-- --></A><H3> | |
MIN_COMPRESSION_THRESHOLD</H3> | |
<PRE> | |
protected static final int <B>MIN_COMPRESSION_THRESHOLD</B></PRE> | |
<DL> | |
<DD>Minimum compress threshold: 384 bytes. | |
<P> | |
<DL> | |
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.click.extras.filter.PerformanceFilter.MIN_COMPRESSION_THRESHOLD">Constant Field Values</A></DL> | |
</DL> | |
<HR> | |
<A NAME="cacheMaxAge"><!-- --></A><H3> | |
cacheMaxAge</H3> | |
<PRE> | |
protected long <B>cacheMaxAge</B></PRE> | |
<DL> | |
<DD>The configured cache max age in seconds, default value is 1 year. | |
<P> | |
<DL> | |
</DL> | |
</DL> | |
<HR> | |
<A NAME="compressionThreshold"><!-- --></A><H3> | |
compressionThreshold</H3> | |
<PRE> | |
protected int <B>compressionThreshold</B></PRE> | |
<DL> | |
<DD>The threshold number to compress, default value is 384 bytes. | |
<P> | |
<DL> | |
</DL> | |
</DL> | |
<HR> | |
<A NAME="compressionEnabled"><!-- --></A><H3> | |
compressionEnabled</H3> | |
<PRE> | |
protected boolean <B>compressionEnabled</B></PRE> | |
<DL> | |
<DD>Indicates if compression is enabled or not, default value is true. | |
<P> | |
<DL> | |
</DL> | |
</DL> | |
<HR> | |
<A NAME="configured"><!-- --></A><H3> | |
configured</H3> | |
<PRE> | |
protected boolean <B>configured</B></PRE> | |
<DL> | |
<DD>The filter has been configured flag. | |
<P> | |
<DL> | |
</DL> | |
</DL> | |
<HR> | |
<A NAME="configService"><!-- --></A><H3> | |
configService</H3> | |
<PRE> | |
protected <A HREF="http://click.apache.org/docs/click-api/org/apache/click/service/ConfigService.html" title="class or interface in org.apache.click.service">ConfigService</A> <B>configService</B></PRE> | |
<DL> | |
<DD>The application configuration service. | |
<P> | |
<DL> | |
</DL> | |
</DL> | |
<HR> | |
<A NAME="filterConfig"><!-- --></A><H3> | |
filterConfig</H3> | |
<PRE> | |
protected <A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/FilterConfig.html" title="class or interface in javax.servlet">FilterConfig</A> <B>filterConfig</B></PRE> | |
<DL> | |
<DD>The filter configuration object we are associated with. If this value | |
is null, this filter instance is not currently configured. | |
<P> | |
<DL> | |
</DL> | |
</DL> | |
<HR> | |
<A NAME="includeDirs"><!-- --></A><H3> | |
includeDirs</H3> | |
<PRE> | |
protected <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>> <B>includeDirs</B></PRE> | |
<DL> | |
<DD>The cacheable-path include directories. | |
<P> | |
<DL> | |
</DL> | |
</DL> | |
<HR> | |
<A NAME="includeFiles"><!-- --></A><H3> | |
includeFiles</H3> | |
<PRE> | |
protected <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>> <B>includeFiles</B></PRE> | |
<DL> | |
<DD>The cacheable-path include files. | |
<P> | |
<DL> | |
</DL> | |
</DL> | |
<HR> | |
<A NAME="excludeDirs"><!-- --></A><H3> | |
excludeDirs</H3> | |
<PRE> | |
protected <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>> <B>excludeDirs</B></PRE> | |
<DL> | |
<DD>The cacheable-path exclude directories. | |
<P> | |
<DL> | |
</DL> | |
</DL> | |
<HR> | |
<A NAME="excludeFiles"><!-- --></A><H3> | |
excludeFiles</H3> | |
<PRE> | |
protected <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html" title="class or interface in java.util">List</A><<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>> <B>excludeFiles</B></PRE> | |
<DL> | |
<DD>The cacheable-path exclude files. | |
<P> | |
<DL> | |
</DL> | |
</DL> | |
<HR> | |
<A NAME="applicationVersionIndicator"><!-- --></A><H3> | |
applicationVersionIndicator</H3> | |
<PRE> | |
protected <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>applicationVersionIndicator</B></PRE> | |
<DL> | |
<DD>The application resource version indicator. | |
<P> | |
<DL> | |
</DL> | |
</DL> | |
<!-- ========= CONSTRUCTOR DETAIL ======== --> | |
<A NAME="constructor_detail"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> | |
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> | |
<B>Constructor Detail</B></FONT></TH> | |
</TR> | |
</TABLE> | |
<A NAME="PerformanceFilter()"><!-- --></A><H3> | |
PerformanceFilter</H3> | |
<PRE> | |
public <B>PerformanceFilter</B>()</PRE> | |
<DL> | |
</DL> | |
<!-- ============ METHOD DETAIL ========== --> | |
<A NAME="method_detail"><!-- --></A> | |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> | |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> | |
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> | |
<B>Method Detail</B></FONT></TH> | |
</TR> | |
</TABLE> | |
<A NAME="init(javax.servlet.FilterConfig)"><!-- --></A><H3> | |
init</H3> | |
<PRE> | |
public void <B>init</B>(<A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/FilterConfig.html" title="class or interface in javax.servlet">FilterConfig</A> filterConfig)</PRE> | |
<DL> | |
<DD>Initialize the filter. | |
<P> | |
<DD><DL> | |
<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/Filter.html#init(javax.servlet.FilterConfig)" title="class or interface in javax.servlet">init</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/Filter.html" title="class or interface in javax.servlet">Filter</A></CODE></DL> | |
</DD> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>filterConfig</CODE> - The filter configuration object<DT><B>See Also:</B><DD><A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/Filter.html#init(javax.servlet.FilterConfig)" title="class or interface in javax.servlet"><CODE>Filter.init(FilterConfig)</CODE></A></DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="destroy()"><!-- --></A><H3> | |
destroy</H3> | |
<PRE> | |
public void <B>destroy</B>()</PRE> | |
<DL> | |
<DD>Take this filter out of service. | |
<P> | |
<DD><DL> | |
<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/Filter.html#destroy()" title="class or interface in javax.servlet">destroy</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/Filter.html" title="class or interface in javax.servlet">Filter</A></CODE></DL> | |
</DD> | |
<DD><DL> | |
<DT><B>See Also:</B><DD><A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/Filter.html#destroy()" title="class or interface in javax.servlet"><CODE>Filter.destroy()</CODE></A></DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)"><!-- --></A><H3> | |
doFilter</H3> | |
<PRE> | |
public void <B>doFilter</B>(<A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletRequest.html" title="class or interface in javax.servlet">ServletRequest</A> servletRequest, | |
<A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletResponse.html" title="class or interface in javax.servlet">ServletResponse</A> servletResponse, | |
<A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/FilterChain.html" title="class or interface in javax.servlet">FilterChain</A> chain) | |
throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A>, | |
<A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletException.html" title="class or interface in javax.servlet">ServletException</A></PRE> | |
<DL> | |
<DD>Perform the filter operation applying any necessary Expire headers and | |
compressing the response content. | |
<P> | |
<DD><DL> | |
<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/Filter.html#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)" title="class or interface in javax.servlet">doFilter</A></CODE> in interface <CODE><A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/Filter.html" title="class or interface in javax.servlet">Filter</A></CODE></DL> | |
</DD> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>servletRequest</CODE> - the servlet request<DD><CODE>servletResponse</CODE> - the servlet response<DD><CODE>chain</CODE> - the filter chain | |
<DT><B>Throws:</B> | |
<DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if an I/O error occurs | |
<DD><CODE><A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletException.html" title="class or interface in javax.servlet">ServletException</A></CODE> - if a servlet error occurs<DT><B>See Also:</B><DD><A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/Filter.html#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)" title="class or interface in javax.servlet"><CODE>Filter.doFilter(ServletRequest, ServletResponse, FilterChain)</CODE></A></DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="setFilterConfig(javax.servlet.FilterConfig)"><!-- --></A><H3> | |
setFilterConfig</H3> | |
<PRE> | |
public void <B>setFilterConfig</B>(<A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/FilterConfig.html" title="class or interface in javax.servlet">FilterConfig</A> filterConfig)</PRE> | |
<DL> | |
<DD>Set filter configuration. This function is equivalent to init and is | |
required by Weblogic 6.1. | |
<P> | |
<DD><DL> | |
</DL> | |
</DD> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>filterConfig</CODE> - the filter configuration object</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getFilterConfig()"><!-- --></A><H3> | |
getFilterConfig</H3> | |
<PRE> | |
public <A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/FilterConfig.html" title="class or interface in javax.servlet">FilterConfig</A> <B>getFilterConfig</B>()</PRE> | |
<DL> | |
<DD>Return filter config. This is required by Weblogic 6.1 | |
<P> | |
<DD><DL> | |
</DL> | |
</DD> | |
<DD><DL> | |
<DT><B>Returns:</B><DD>the filter configuration</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getConfigService()"><!-- --></A><H3> | |
getConfigService</H3> | |
<PRE> | |
protected <A HREF="http://click.apache.org/docs/click-api/org/apache/click/service/ConfigService.html" title="class or interface in org.apache.click.service">ConfigService</A> <B>getConfigService</B>()</PRE> | |
<DL> | |
<DD>Return the application configuration service. | |
<P> | |
<DD><DL> | |
</DL> | |
</DD> | |
<DD><DL> | |
<DT><B>Returns:</B><DD>the application configuration service</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="loadConfiguration()"><!-- --></A><H3> | |
loadConfiguration</H3> | |
<PRE> | |
protected void <B>loadConfiguration</B>()</PRE> | |
<DL> | |
<DD>Load the filters configuration and set the configured flat to true. | |
<P> | |
<DD><DL> | |
</DL> | |
</DD> | |
<DD><DL> | |
</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="isExcludePath(java.lang.String)"><!-- --></A><H3> | |
isExcludePath</H3> | |
<PRE> | |
protected boolean <B>isExcludePath</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> path)</PRE> | |
<DL> | |
<DD>Return true if a path should be excluded from the performance filter. | |
<P> | |
<DD><DL> | |
</DL> | |
</DD> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>path</CODE> - the request path to test | |
<DT><B>Returns:</B><DD>true if the response should be excluded from the performance filter</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getResourceVersionIndicator(java.lang.String)"><!-- --></A><H3> | |
getResourceVersionIndicator</H3> | |
<PRE> | |
protected <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getResourceVersionIndicator</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> path)</PRE> | |
<DL> | |
<DD>Return the <tt>version indicator</tt> for the specified path. | |
<P> | |
<DD><DL> | |
</DL> | |
</DD> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>path</CODE> - the resource path | |
<DT><B>Returns:</B><DD>a version indicator for web resources</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="getApplicationResourceVersionIndicator(java.lang.String)"><!-- --></A><H3> | |
getApplicationResourceVersionIndicator</H3> | |
<PRE> | |
protected <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getApplicationResourceVersionIndicator</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> path)</PRE> | |
<DL> | |
<DD>Return the application <tt>version indicator</tt> for the specified path. | |
<P> | |
<DD><DL> | |
</DL> | |
</DD> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>path</CODE> - the resource path | |
<DT><B>Returns:</B><DD>an application version indicator for web resources</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="stripResourceVersionIndicator(java.lang.String)"><!-- --></A><H3> | |
stripResourceVersionIndicator</H3> | |
<PRE> | |
protected <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>stripResourceVersionIndicator</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> path)</PRE> | |
<DL> | |
<DD>Removes the version indicator from the specified path. | |
<p/> | |
For example, given the path <tt>'/example/control_1.4.js'</tt>, where | |
<tt>'_1.4'</tt> is the <tt>version indicator</tt>, this method will | |
return <tt>'/example/control.js'</tt>. | |
<P> | |
<DD><DL> | |
</DL> | |
</DD> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>path</CODE> - the resource path | |
<DT><B>Returns:</B><DD>path without the version indicator<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#getResourceVersionIndicator(java.lang.String)"><CODE>getResourceVersionIndicator(String)</CODE></A>, | |
<A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#getApplicationResourceVersionIndicator(java.lang.String)"><CODE>getApplicationResourceVersionIndicator(java.lang.String)</CODE></A></DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="setHeaderExpiresCache(javax.servlet.http.HttpServletResponse, long)"><!-- --></A><H3> | |
setHeaderExpiresCache</H3> | |
<PRE> | |
protected void <B>setHeaderExpiresCache</B>(<A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpServletResponse.html" title="class or interface in javax.servlet.http">HttpServletResponse</A> response, | |
long maxAgeSeconds)</PRE> | |
<DL> | |
<DD>Set the response "Expires" and "Cache-Control" headers with the given | |
maximum cache duration age in seconds. | |
<P> | |
<DD><DL> | |
</DL> | |
</DD> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>response</CODE> - the response to set the headers in<DD><CODE>maxAgeSeconds</CODE> - the maximum cache duration in seconds</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="useForeverCacheHeader(java.lang.String)"><!-- --></A><H3> | |
useForeverCacheHeader</H3> | |
<PRE> | |
protected boolean <B>useForeverCacheHeader</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> path)</PRE> | |
<DL> | |
<DD>Return true if a path is a static versioned resource and should be | |
cached forever. | |
<P> | |
<DD><DL> | |
</DL> | |
</DD> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>path</CODE> - the request path to test | |
<DT><B>Returns:</B><DD>true if the response should be cached forever<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#getResourceVersionIndicator(java.lang.String)"><CODE>getResourceVersionIndicator(java.lang.String)</CODE></A>, | |
<A HREF="../../../../../org/apache/click/extras/filter/PerformanceFilter.html#getApplicationResourceVersionIndicator(java.lang.String)"><CODE>getApplicationResourceVersionIndicator(java.lang.String)</CODE></A></DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="useConfiguredCacheHeader(java.lang.String)"><!-- --></A><H3> | |
useConfiguredCacheHeader</H3> | |
<PRE> | |
protected boolean <B>useConfiguredCacheHeader</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> path)</PRE> | |
<DL> | |
<DD>Return true if the response should be cached using the configured cache | |
max-age. | |
<P> | |
<DD><DL> | |
</DL> | |
</DD> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>path</CODE> - the request path to test | |
<DT><B>Returns:</B><DD>true if the response should be cached with the configured max-age</DL> | |
</DD> | |
</DL> | |
<HR> | |
<A NAME="useGzipCompression(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String)"><!-- --></A><H3> | |
useGzipCompression</H3> | |
<PRE> | |
protected boolean <B>useGzipCompression</B>(<A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpServletRequest.html" title="class or interface in javax.servlet.http">HttpServletRequest</A> request, | |
<A HREF="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpServletResponse.html" title="class or interface in javax.servlet.http">HttpServletResponse</A> response, | |
<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> path)</PRE> | |
<DL> | |
<DD>Return true if the response should be GZIP compressed. | |
<P> | |
<DD><DL> | |
</DL> | |
</DD> | |
<DD><DL> | |
<DT><B>Parameters:</B><DD><CODE>request</CODE> - the request to test<DD><CODE>response</CODE> - the response to test<DD><CODE>path</CODE> - the request path to test | |
<DT><B>Returns:</B><DD>true if the response should be GZIP compressed</DL> | |
</DD> | |
</DL> | |
<!-- ========= END OF CLASS DATA ========= --> | |
<HR> | |
<!-- ======= START OF BOTTOM NAVBAR ====== --> | |
<A NAME="navbar_bottom"><!-- --></A> | |
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> | |
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> | |
<TR> | |
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> | |
<A NAME="navbar_bottom_firstrow"><!-- --></A> | |
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> | |
<TR ALIGN="center" VALIGN="top"> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> | |
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> | |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> | |
</TR> | |
</TABLE> | |
</TD> | |
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> | |
</EM> | |
</TD> | |
</TR> | |
<TR> | |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> | |
<A HREF="../../../../../org/apache/click/extras/filter/CompressionServletResponseWrapper.html" title="class in org.apache.click.extras.filter"><B>PREV CLASS</B></A> | |
NEXT CLASS</FONT></TD> | |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> | |
<A HREF="../../../../../index.html?org/apache/click/extras/filter/PerformanceFilter.html" target="_top"><B>FRAMES</B></A> | |
<A HREF="PerformanceFilter.html" target="_top"><B>NO FRAMES</B></A> | |
<SCRIPT type="text/javascript"> | |
<!-- | |
if(window==top) { | |
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); | |
} | |
//--> | |
</SCRIPT> | |
<NOSCRIPT> | |
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> | |
</NOSCRIPT> | |
</FONT></TD> | |
</TR> | |
<TR> | |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> | |
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> | |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> | |
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> | |
</TR> | |
</TABLE> | |
<A NAME="skip-navbar_bottom"></A> | |
<!-- ======== END OF BOTTOM NAVBAR ======= --> | |
<HR> | |
<style type='text/css'>.str{color:#2A00FF;}.kwd{color:#7F0055;font-weight:bold;}.com{color:#3F7F5F;}.typ{color:#000;}.lit{color:#066;}.pun{color:#660;}.pln{color:#000;}.tag{color:#000099;font-weight:bold;}.atn{color:#009900;}.atv{color:#000;}.dec{color:#606;}pre.prettyprint{padding:1em;border:1px solid #888;overflow:auto;}@media print{.str{color:#2A00FF;}.kwd{color:#7F0055;font-weight:bold;}.com{color:#3F7F5F;font-style:italic;}.typ{color:#000;font-weight:bold;}.lit{color:#044;}.pun{color:#440;}.pln{color:#000;}.tag{color:#000099;font-weight:bold;}.atn{color:#009900;}.atv{color:#000;}}</style><script type='text/javascript'>var PR_keywords={};(function(){var CPP_KEYWORDS='abstract bool break case catch char class const '+'const_cast continue default delete deprecated dllexport dllimport do '+'double dynamic_cast else enum explicit extern false float for friend '+'goto if inline int long mutable naked namespace new noinline noreturn '+'nothrow novtable operator private property protected public register '+'reinterpret_cast return selectany short signed sizeof static '+'static_cast struct switch template this thread throw true try typedef '+'typeid typename union unsigned using declaration, directive uuid '+'virtual void volatile while typeof';var CSHARP_KEYWORDS='as base by byte checked decimal delegate descending '+'event finally fixed foreach from group implicit in interface internal '+'into is lock null object override orderby params readonly ref sbyte '+'sealed stackalloc string select uint ulong unchecked unsafe ushort var';var JAVA_KEYWORDS='package synchronized boolean implements import throws '+'instanceof transient extends final strictfp native super';var JSCRIPT_KEYWORDS='debugger export function with NaN Infinity';var PERL_KEYWORDS='require sub unless until use elsif BEGIN END';var PYTHON_KEYWORDS='and assert def del elif except exec global lambda '+'not or pass print raise yield False True None';var RUBY_KEYWORDS='then end begin rescue ensure module when undef next '+'redo retry alias defined';var SH_KEYWORDS='done fi';var KEYWORDS=[CPP_KEYWORDS,CSHARP_KEYWORDS,JAVA_KEYWORDS,JSCRIPT_KEYWORDS,PERL_KEYWORDS,PYTHON_KEYWORDS,RUBY_KEYWORDS,SH_KEYWORDS];for(var k=0;k<KEYWORDS.length;k++){var kw=KEYWORDS[k].split(' ');for(var i=0;i<kw.length;i++){if(kw[i]){PR_keywords[kw[i]]=true;}}}}).call(this);var PR_STRING='str';var PR_KEYWORD='kwd';var PR_COMMENT='com';var PR_TYPE='typ';var PR_LITERAL='lit';var PR_PUNCTUATION='pun';var PR_PLAIN='pln';var PR_TAG='tag';var PR_DECLARATION='dec';var PR_SOURCE='src';var PR_ATTRIB_NAME='atn';var PR_ATTRIB_VALUE='atv';var PR_TAB_WIDTH=8;function PR_isWordChar(ch){return(ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z');}function PR_spliceArrayInto(inserted,container,containerPosition,countReplaced){inserted.unshift(containerPosition,countReplaced||0);try{container.splice.apply(container,inserted);}finally{inserted.splice(0,2);}}var REGEXP_PRECEDER_PATTERN=(function(){var preceders=['!','!=','!==','#','%','%=','&','&&','&&=','&=','(','*','*=','+=',',','-=','->','/','/=',':','::',';','<','<<','<<=','<=','=','==','===','>','>=','>>','>>=','>>>','>>>=','?','@','[','^','^=','^^','^^=','{','|','|=','||','||=','~','break','case','continue','delete','do','else','finally','instanceof','return','throw','try','typeof'];var pattern='(?:'+'(?:(?:^|[^0-9\.])\\.{1,3})|'+'(?:(?:^|[^\\+])\\+)|'+'(?:(?:^|[^\\-])-)';for(var i=0;i<preceders.length;++i){var preceder=preceders[i];if(PR_isWordChar(preceder.charAt(0))){pattern+='|\\b'+preceder;}else{pattern+='|'+preceder.replace(/([^=<>:&])/g,'\\$1');}}pattern+='|^)\\s*$';return new RegExp(pattern);})();var pr_amp=/&/g;var pr_lt=/</g;var pr_gt=/>/g;var pr_quot=/"/g;function PR_attribToHtml(str){return str.replace(pr_amp,'&').replace(pr_lt,'<').replace(pr_gt,'>').replace(pr_quot,'"');}function PR_textToHtml(str){return str.replace(pr_amp,'&').replace(pr_lt,'<').replace(pr_gt,'>');}var pr_ltEnt=/</g;var pr_gtEnt=/>/g;var pr_aposEnt=/'/g;var pr_quotEnt=/"/g;var pr_ampEnt=/&/g;function PR_htmlToText(html){var pos=html.indexOf('&');if(pos<0){return html;}for(--pos;(pos=html.indexOf('&#',pos+1))>=0;){var end=html.indexOf(';',pos);if(end>=0){var num=html.substring(pos+3,end);var radix=10;if(num&&num.charAt(0)=='x'){num=num.substring(1);radix=16;}var codePoint=parseInt(num,radix);if(!isNaN(codePoint)){html=(html.substring(0,pos)+String.fromCharCode(codePoint)+html.substring(end+1));}}}return html.replace(pr_ltEnt,'<').replace(pr_gtEnt,'>').replace(pr_aposEnt,"'").replace(pr_quotEnt,'"').replace(pr_ampEnt,'&');}function PR_isRawContent(node){return'XMP'==node.tagName;}var PR_innerHtmlWorks=null;function PR_getInnerHtml(node){if(null===PR_innerHtmlWorks){var testNode=document.createElement('PRE');testNode.appendChild(document.createTextNode('<!DOCTYPE foo PUBLIC "foo bar">\n<foo />'));PR_innerHtmlWorks=!/</.test(testNode.innerHTML);}if(PR_innerHtmlWorks){var content=node.innerHTML;if(PR_isRawContent(node)){content=PR_textToHtml(content);}return content;}var out=[];for(var child=node.firstChild;child;child=child.nextSibling){PR_normalizedHtml(child,out);}return out.join('');}function PR_normalizedHtml(node,out){switch(node.nodeType){case 1:var name=node.tagName.toLowerCase();out.push('\074',name);for(var i=0;i<node.attributes.length;++i){var attr=node.attributes[i];if(!attr.specified){continue;}out.push(' ');PR_normalizedHtml(attr,out);}out.push('>');for(var child=node.firstChild;child;child=child.nextSibling){PR_normalizedHtml(child,out);}if(node.firstChild||!/^(?:br|link|img)$/.test(name)){out.push('<\/',name,'>');}break;case 2:out.push(node.name.toLowerCase(),'="',PR_attribToHtml(node.value),'"');break;case 3:case 4:out.push(PR_textToHtml(node.nodeValue));break;}}function PR_tabExpander(tabWidth){var SPACES=' ';var charInLine=0;return function(plainText){var out=null;var pos=0;for(var i=0,n=plainText.length;i<n;++i){var ch=plainText.charAt(i);switch(ch){case'\t':if(!out){out=[];}out.push(plainText.substring(pos,i));var nSpaces=tabWidth-(charInLine%tabWidth);charInLine+=nSpaces;for(;nSpaces>=0;nSpaces-=SPACES.length){out.push(SPACES.substring(0,nSpaces));}pos=i+1;break;case'\n':charInLine=0;break;default:++charInLine;}}if(!out){return plainText;}out.push(plainText.substring(pos));return out.join('');};}var pr_chunkPattern=/(?:[^<]+|<!--[\s\S]*?-->|<!\[CDATA\[([\s\S]*?)\]\]>|<\/?[a-zA-Z][^>]*>|<)/g;var pr_commentPrefix=/^<!--/;var pr_cdataPrefix=/^<\[CDATA\[/;var pr_brPrefix=/^<br\b/i;function PR_extractTags(s){var matches=s.match(pr_chunkPattern);var sourceBuf=[];var sourceBufLen=0;var extractedTags=[];if(matches){for(var i=0,n=matches.length;i<n;++i){var match=matches[i];if(match.length>1&&match.charAt(0)==='<'){if(pr_commentPrefix.test(match)){continue;}if(pr_cdataPrefix.test(match)){sourceBuf.push(match.substring(9,match.length-3));sourceBufLen+=match.length-12;}else if(pr_brPrefix.test(match)){sourceBuf.push('\n');sourceBufLen+=1;}else{extractedTags.push(sourceBufLen,match);}}else{var literalText=PR_htmlToText(match);sourceBuf.push(literalText);sourceBufLen+=literalText.length;}}}return{source:sourceBuf.join(''),tags:extractedTags};}function PR_createSimpleLexer(shortcutStylePatterns,fallthroughStylePatterns){var shortcuts={};(function(){var allPatterns=shortcutStylePatterns.concat(fallthroughStylePatterns);for(var i=allPatterns.length;--i>=0;){var patternParts=allPatterns[i];var shortcutChars=patternParts[3];if(shortcutChars){for(var c=shortcutChars.length;--c>=0;){shortcuts[shortcutChars.charAt(c)]=patternParts;}}}})();var nPatterns=fallthroughStylePatterns.length;return function(sourceCode,opt_basePos){opt_basePos=opt_basePos||0;var decorations=[opt_basePos,PR_PLAIN];var lastToken='';var pos=0;var tail=sourceCode;while(tail.length){var style;var token=null;var patternParts=shortcuts[tail.charAt(0)];if(patternParts){var match=tail.match(patternParts[1]);token=match[0];style=patternParts[0];}else{for(var i=0;i<nPatterns;++i){patternParts=fallthroughStylePatterns[i];var contextPattern=patternParts[2];if(contextPattern&&!contextPattern.test(lastToken)){continue;}var match=tail.match(patternParts[1]);if(match){token=match[0];style=patternParts[0];break;}}if(!token){style=PR_PLAIN;token=tail.substring(0,1);}}decorations.push(opt_basePos+pos,style);pos+=token.length;tail=tail.substring(token.length);if(style!==PR_COMMENT&&/\S/.test(token)){lastToken=token;}}return decorations;};}var PR_C_STYLE_STRING_AND_COMMENT_LEXER=PR_createSimpleLexer([[PR_STRING,/^\'(?:[^\\\']|\\[\s\S])*(?:\'|$)/,null,"'"],[PR_STRING,/^"(?:[^\\"]|\\[\s\S])*(?:"|$)/,null,'"'],[PR_STRING,/^\`(?:[^\\\`]|\\[\s\S])*(?:\`|$)/,null,'`']],[[PR_PLAIN,/^(?:[^\'"\`\/\#]+)/,null,' \r\n'],[PR_COMMENT,/^#[^\r\n]*/,null,'#'],[PR_COMMENT,/^\/\/[^\r\n]*/,null],[PR_STRING,/^\/(?:[^\\\*\/]|\\[\s\S])+(?:\/|$)/,REGEXP_PRECEDER_PATTERN],[PR_COMMENT,/^\/\*[\s\S]*?(?:\*\/|$)/,null]]);function PR_splitStringAndCommentTokens(sourceCode){return PR_C_STYLE_STRING_AND_COMMENT_LEXER(sourceCode);}var PR_C_STYLE_LITERAL_IDENTIFIER_PUNC_RECOGNIZER=PR_createSimpleLexer([],[[PR_PLAIN,/^\s+/,null,' \r\n'],[PR_PLAIN,/^[a-z_$@][a-z_$@0-9]*/i,null],[PR_LITERAL,/^0x[a-f0-9]+[a-z]/i,null],[PR_LITERAL,/^(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?[a-z]*/i,null,'123456789'],[PR_PUNCTUATION,/^[^\s\w\.$@]+/,null]]);function PR_splitNonStringNonCommentTokens(source,decorations){for(var i=0;i<decorations.length;i+=2){var style=decorations[i+1];if(style===PR_PLAIN){var start=decorations[i];var end=i+2<decorations.length?decorations[i+2]:source.length;var chunk=source.substring(start,end);var subDecs=PR_C_STYLE_LITERAL_IDENTIFIER_PUNC_RECOGNIZER(chunk,start);for(var j=0,m=subDecs.length;j<m;j+=2){var subStyle=subDecs[j+1];if(subStyle===PR_PLAIN){var subStart=subDecs[j];var subEnd=j+2<m?subDecs[j+2]:chunk.length;var token=source.substring(subStart,subEnd);if(token=='.'){subDecs[j+1]=PR_PUNCTUATION;}else if(token in PR_keywords){subDecs[j+1]=PR_KEYWORD;}else if(/^@?[A-Z][A-Z$]*[a-z][A-Za-z$]*$/.test(token)){subDecs[j+1]=token.charAt(0)=='@'?PR_LITERAL:PR_TYPE;}}}PR_spliceArrayInto(subDecs,decorations,i,2);i+=subDecs.length-2;}}return decorations;}var PR_MARKUP_LEXER=PR_createSimpleLexer([],[[PR_PLAIN,/^[^<]+/,null],[PR_DECLARATION,/^<!\w[^>]*(?:>|$)/,null],[PR_COMMENT,/^<!--[\s\S]*?(?:-->|$)/,null],[PR_SOURCE,/^<\?[\s\S]*?(?:\?>|$)/,null],[PR_SOURCE,/^<%[\s\S]*?(?:%>|$)/,null],[PR_SOURCE,/^<(script|style|xmp)\b[^>]*>[\s\S]*?<\/\1\b[^>]*>/i,null],[PR_TAG,/^<\/?\w[^<>]*>/,null]]);var PR_SOURCE_CHUNK_PARTS=/^(<[^>]*>)([\s\S]*)(<\/[^>]*>)$/;function PR_tokenizeMarkup(source){var decorations=PR_MARKUP_LEXER(source);for(var i=0;i<decorations.length;i+=2){if(decorations[i+1]===PR_SOURCE){var start=decorations[i];var end=i+2<decorations.length?decorations[i+2]:source.length;var sourceChunk=source.substring(start,end);var match=(sourceChunk.match(PR_SOURCE_CHUNK_PARTS));if(match){decorations.splice(i,2,start,PR_TAG,start+match[1].length,PR_SOURCE,start+match[1].length+(match[2]||'').length,PR_TAG);}}}return decorations;}var PR_TAG_LEXER=PR_createSimpleLexer([[PR_ATTRIB_VALUE,/^\'[^\']*(?:\'|$)/,null,"'"],[PR_ATTRIB_VALUE,/^"[^"]*(?:"|$)/,null,'"'],[PR_PUNCTUATION,/^[<>\/=]+/,null,'<>/=']],[[PR_TAG,/^[\w-]+/,/^</],[PR_ATTRIB_VALUE,/^[\w-]+/,/^=/],[PR_ATTRIB_NAME,/^[\w-]+/,null],[PR_PLAIN,/^\s+/,null,' \r\n']]);function PR_splitTagAttributes(source,decorations){for(var i=0;i<decorations.length;i+=2){var style=decorations[i+1];if(style===PR_TAG){var start=decorations[i];var end=i+2<decorations.length?decorations[i+2]:source.length;var chunk=source.substring(start,end);var subDecorations=PR_TAG_LEXER(chunk,start);PR_spliceArrayInto(subDecorations,decorations,i,2);i+=subDecorations.length-2;}}return decorations;}function PR_splitSourceNodes(source,decorations){for(var i=0;i<decorations.length;i+=2){var style=decorations[i+1];if(style==PR_SOURCE){var start=decorations[i];var end=i+2<decorations.length?decorations[i+2]:source.length;var subDecorations=PR_decorateSource(source.substring(start,end));for(var j=0,m=subDecorations.length;j<m;j+=2){subDecorations[j]+=start;}PR_spliceArrayInto(subDecorations,decorations,i,2);i+=subDecorations.length-2;}}return decorations;}function PR_splitSourceAttributes(source,decorations){var nextValueIsSource=false;for(var i=0;i<decorations.length;i+=2){var style=decorations[i+1];if(style===PR_ATTRIB_NAME){var start=decorations[i];var end=i+2<decorations.length?decorations[i+2]:source.length;nextValueIsSource=/^on|^style$/i.test(source.substring(start,end));}else if(style==PR_ATTRIB_VALUE){if(nextValueIsSource){var start=decorations[i];var end=i+2<decorations.length?decorations[i+2]:source.length;var attribValue=source.substring(start,end);var attribLen=attribValue.length;var quoted=(attribLen>=2&&/^["\']/.test(attribValue)&&attribValue.charAt(0)===attribValue.charAt(attribLen-1));var attribSource;var attribSourceStart;var attribSourceEnd;if(quoted){attribSourceStart=start+1;attribSourceEnd=end-1;attribSource=attribValue;}else{attribSourceStart=start+1;attribSourceEnd=end-1;attribSource=attribValue.substring(1,attribValue.length-1);}var attribSourceDecorations=PR_decorateSource(attribSource);for(var j=0,m=attribSourceDecorations.length;j<m;j+=2){attribSourceDecorations[j]+=attribSourceStart;}if(quoted){attribSourceDecorations.push(attribSourceEnd,PR_ATTRIB_VALUE);PR_spliceArrayInto(attribSourceDecorations,decorations,i+2,0);}else{PR_spliceArrayInto(attribSourceDecorations,decorations,i,2);}}nextValueIsSource=false;}}return decorations;}function PR_decorateSource(sourceCode){var decorations=PR_splitStringAndCommentTokens(sourceCode);decorations=PR_splitNonStringNonCommentTokens(sourceCode,decorations);return decorations;}function PR_decorateMarkup(sourceCode){var decorations=PR_tokenizeMarkup(sourceCode);decorations=PR_splitTagAttributes(sourceCode,decorations);decorations=PR_splitSourceNodes(sourceCode,decorations);decorations=PR_splitSourceAttributes(sourceCode,decorations);return decorations;}function PR_recombineTagsAndDecorations(sourceText,extractedTags,decorations){var html=[];var outputIdx=0;var openDecoration=null;var currentDecoration=null;var tagPos=0;var decPos=0;var tabExpander=PR_tabExpander(PR_TAB_WIDTH);function emitTextUpTo(sourceIdx){if(sourceIdx>outputIdx){if(openDecoration&&openDecoration!==currentDecoration){html.push('</span>');openDecoration=null;}if(!openDecoration&¤tDecoration){openDecoration=currentDecoration;html.push('<span class="',openDecoration,'">');}var htmlChunk=PR_textToHtml(tabExpander(sourceText.substring(outputIdx,sourceIdx))).replace(/(\r\n?|\n| ) /g,'$1 ').replace(/\r\n?|\n/g,' <br>');html.push(htmlChunk);outputIdx=sourceIdx;}}while(true){var outputTag;if(tagPos<extractedTags.length){if(decPos<decorations.length){outputTag=extractedTags[tagPos]<=decorations[decPos];}else{outputTag=true;}}else{outputTag=false;}if(outputTag){emitTextUpTo(extractedTags[tagPos]);if(openDecoration){html.push('</span>');openDecoration=null;}html.push(extractedTags[tagPos+1]);tagPos+=2;}else if(decPos<decorations.length){emitTextUpTo(decorations[decPos]);currentDecoration=decorations[decPos+1];decPos+=2;}else{break;}}emitTextUpTo(sourceText.length);if(openDecoration){html.push('</span>');}return html.join('');}function prettyPrintOne(sourceCodeHtml){try{var sourceAndExtractedTags=PR_extractTags(sourceCodeHtml);var source=sourceAndExtractedTags.source;var extractedTags=sourceAndExtractedTags.tags;var isMarkup=/^\s*</.test(source)&&/>\s*$/.test(source);var decorations=isMarkup?PR_decorateMarkup(source):PR_decorateSource(source);return PR_recombineTagsAndDecorations(source,extractedTags,decorations);}catch(e){if('console'in window){console.log(e);console.trace();}return sourceCodeHtml;}}var PR_SHOULD_USE_CONTINUATION=true;function prettyPrint(opt_whenDone){var codeSegments=[document.getElementsByTagName('pre'),document.getElementsByTagName('code'),document.getElementsByTagName('xmp')];var elements=[];for(var i=0;i<codeSegments.length;++i){for(var j=0;j<codeSegments[i].length;++j){elements.push(codeSegments[i][j]);}}codeSegments=null;var k=0;function doWork(){var endTime=(PR_SHOULD_USE_CONTINUATION?new Date().getTime()+250:Infinity);for(;k<elements.length&&new Date().getTime()<endTime;k++){var cs=elements[k];if(cs.className&&cs.className.indexOf('prettyprint')>=0){var nested=false;for(var p=cs.parentNode;p!=null;p=p.parentNode){if((p.tagName=='pre'||p.tagName=='code'||p.tagName=='xmp')&&p.className&&p.className.indexOf('prettyprint')>=0){nested=true;break;}}if(!nested){var content=PR_getInnerHtml(cs);content=content.replace(/(?:\r\n?|\n)$/,'');var newContent=prettyPrintOne(content);if(!PR_isRawContent(cs)){cs.innerHTML=newContent;}else{var pre=document.createElement('PRE');for(var i=0;i<cs.attributes.length;++i){var a=cs.attributes[i];if(a.specified){pre.setAttribute(a.name,a.value);}}pre.innerHTML=newContent;cs.parentNode.replaceChild(pre,cs);}}}}if(k<elements.length){setTimeout(doWork,250);}else if(opt_whenDone){opt_whenDone();}}doWork();}</script><script type='text/javascript'>prettyPrint();</script></BODY> | |
</HTML> |