|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--javawebparts.filter.JSCompressionFilter
This filter does some simple javascript compressing in the response.
It uses a slightly modified version of JSMin.java from John Reilly which,
in it's turn, is a java version of Douglas Crockford's jsmin.c. If you
want to know how it works and what is does: www.crockford.com
It allows for including or excluding paths from filter functionality.
Init parameters are:
| Field Summary | |
private static org.apache.commons.logging.Log |
log
Log instance. |
private static java.util.ArrayList |
pathList
List of paths for filter functionality determination. |
private static java.lang.String |
pathSpec
Whether pathList includes or excludes. |
| Constructor Summary | |
JSCompressionFilter()
|
|
| Method Summary | |
private byte[] |
compress(byte[] bytes,
boolean isHtml)
Do compression. |
void |
destroy()
Destroy. |
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain filterChain)
Do filter's work. |
void |
init(javax.servlet.FilterConfig filterConfig)
Initialize this filter. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static org.apache.commons.logging.Log log
private static java.lang.String pathSpec
private static java.util.ArrayList pathList
| Constructor Detail |
public JSCompressionFilter()
| Method Detail |
public void destroy()
destroy in interface javax.servlet.Filter
public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
init in interface javax.servlet.FilterfilterConfig - The configuration information for this filter.
javax.servlet.ServletException - ServletException.
public void doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain filterChain)
throws javax.servlet.ServletException,
java.io.IOException
doFilter in interface javax.servlet.Filterrequest - The current request object.response - The current response object.filterChain - The current filter chain.
javax.servlet.ServletException - ServletException.
java.io.IOException - IOException.
private byte[] compress(byte[] bytes,
boolean isHtml)
bytes - The text to checkisHtml - Are we compressing Html (or a .js file)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||