|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nakedobjects.webapp.StaticContentFilter
public class StaticContentFilter
Adapted from http://www.digitalsanctuary.com/tech-blog/java/jboss/setting-cache-headers-from-jboss.html
Usage:
<filter>
<filter-name>StaticContentFilter</filter-name>
<filter-class>org.nakedobjects.webapp.StaticContentFilter</filter-class>
<init-param>
<param-name>CacheTime</param-name>
<param-value>86400</param-value>
</init-param>
</filter>
...
<filter-mapping>
<filter-name>StaticContentFilter</filter-name>
<url-pattern>*.js</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>StaticContentFilter</filter-name>
<url-pattern>*.css</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>StaticContentFilter</filter-name>
<url-pattern>*.jpg</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>StaticContentFilter</filter-name>
<url-pattern>*.png</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>StaticContentFilter</filter-name>
<url-pattern>*.gif</url-pattern>
</filter-mapping>
| Constructor Summary | |
|---|---|
StaticContentFilter()
|
|
| Method Summary | |
|---|---|
void |
destroy()
Destroy all humans! |
void |
doFilter(javax.servlet.ServletRequest pRequest,
javax.servlet.ServletResponse pResponse,
javax.servlet.FilterChain pChain)
Do filter. |
void |
init(javax.servlet.FilterConfig pConfig)
Initializes the Servlet filter with the cache time and sets up the unchanging headers. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StaticContentFilter()
| Method Detail |
|---|
public void init(javax.servlet.FilterConfig pConfig)
init in interface javax.servlet.FilterpConfig - the configFilter.init(javax.servlet.FilterConfig)
public void doFilter(javax.servlet.ServletRequest pRequest,
javax.servlet.ServletResponse pResponse,
javax.servlet.FilterChain pChain)
throws java.io.IOException,
javax.servlet.ServletException
doFilter in interface javax.servlet.FilterpRequest - the requestpResponse - the responsepChain - the chain
java.io.IOException - Signals that an I/O exception has occurred.
javax.servlet.ServletException - the servlet exceptionFilter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse,
javax.servlet.FilterChain)public void destroy()
destroy in interface javax.servlet.FilterFilter.destroy()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||