|
GWT Tk 0.2.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectasquare.gwt.tk.server.GWTCacheFilter
public class GWTCacheFilter
This is a filter which enforces proper caching of the generated GWT script files. It requires that serve your GWT application via a Java servlet container.
To use, add the jar to WEB-INF/lib and add the
following to your deployment descriptor (web.xml):
<filter> <filter-name>GWTCacheFilter</filter-name> <filter-class>asquare.gwt.tk.server.GWTCacheFilter</filter-class> <description>Enforces proper caching of GWT script files</description> </filter> <filter-mapping> <filter-name>GWTCacheFilter</filter-name> <url-pattern>*.html</url-pattern> </filter-mapping>By default, files ending in
.cache.html are cached and files
ending in .nocache.html are not cached. You can override the
defaults by specifying file name patterns in filter init-params. The pattern
is parsed as a JDK regular expression. The defaults are below:
<init-param> <param-name>forceDontCache</param-name> <param-value>.+\.nocache.html</param-value> </init-param> <init-param> <param-name>forceCache</param-name> <param-value>.+\.cache.html</param-value> </init-param>
Usage notes
*.nocache.html or
*.cache.html for url patterns. According to the 2.3 servlet
spec, an extension is defined as the characters after the last
period.
| Field Summary | |
|---|---|
static String |
DEFAULT_FORCECACHE
The default value of the forceDontCache init-param. |
static String |
DEFAULT_FORCEDONTCACHE
The default value of the forceCache init-param. |
static String |
INITPARAM_FORCECACHE
The name of the filter init-param which specifies files to cache. |
static String |
INITPARAM_FORCEDONTCACHE
The name of the filter init-param which specifies files not to cache. |
| Constructor Summary | |
|---|---|
GWTCacheFilter()
|
|
| Method Summary | |
|---|---|
void |
destroy()
|
void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
|
void |
init(FilterConfig filterConfig)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String INITPARAM_FORCEDONTCACHE
"forceDontCache".
public static final String INITPARAM_FORCECACHE
"forceCache".
public static final String DEFAULT_FORCEDONTCACHE
forceCache init-param.
The value is ".+\\.nocache.html".
public static final String DEFAULT_FORCECACHE
forceDontCache init-param.
The value is ".+\\.cache.html".
| Constructor Detail |
|---|
public GWTCacheFilter()
| Method Detail |
|---|
public void init(FilterConfig filterConfig)
throws ServletException
init in interface FilterServletException
public void doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain)
throws IOException,
ServletException
doFilter in interface FilterIOException
ServletExceptionpublic void destroy()
destroy in interface Filter
|
GWT Tk 0.2.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||