|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object velosurf.util.TemplateNameFilter
@Deprecated public class TemplateNameFilter
Deprecated. Recommended practice is to use .vhtml, .vjs, .vcss, etc... and to not rename templates. When using a J2EE container behind Apache web server, it makes it easy to let Apache serve static files.
This class is a forwarding filter which allows to hide ".vtl" from resource URLs. It works by building a cache of all template names in the webapp, and adding
The purpose of this feature is to allow URLs to be independant of the status of the resource: regular file or template file, allowing this status to transparently change over time. You can store all resources in the same directory tree, templates having an additional ".vtl" like in "foo.html.vtl" or "bar.js.vtl".
In development mode, you can choose either to reset the cache periodically, or manually with the "reset-cache" URI, or both.
Initialization parameters:
Field Summary | |
---|---|
private long |
lastReset
Deprecated. |
private static int |
RESET_MANUAL
Deprecated. MANUAL reset method. |
private static int |
RESET_NONE
Deprecated. NONE reset method. |
private static int |
RESET_PERIODIC
Deprecated. PERIODIC reset method. |
private int |
resetMethod
Deprecated. reset method. |
private long |
resetPeriod
Deprecated. reset period. |
private java.lang.String |
resetUri
Deprecated. reset uri. |
private javax.servlet.ServletContext |
servletContext
Deprecated. the servlet context. |
private java.lang.String |
templateExtension
Deprecated. targeted template extension. |
private java.util.Set<java.lang.String> |
templates
Deprecated. |
Constructor Summary | |
---|---|
TemplateNameFilter()
Deprecated. |
Method Summary | |
---|---|
private void |
buildsTemplateNamesList(javax.servlet.http.HttpServletResponse response)
Deprecated. Build the cache, which consists of a hash set containing all template names. |
void |
destroy()
Deprecated. Destroy the filter. |
void |
doFilter(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain filterChain)
Deprecated. doFilter method. |
void |
init(javax.servlet.FilterConfig filterConfig)
Deprecated. init the filter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private javax.servlet.ServletContext servletContext
private java.lang.String templateExtension
private static final int RESET_NONE
private static final int RESET_MANUAL
private static final int RESET_PERIODIC
private int resetMethod
private java.lang.String resetUri
private long resetPeriod
private java.util.Set<java.lang.String> templates
private long lastReset
Constructor Detail |
---|
public TemplateNameFilter()
Method Detail |
---|
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
filterConfig
- filter configuration
javax.servlet.ServletException
private void buildsTemplateNamesList(javax.servlet.http.HttpServletResponse response)
public void doFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain filterChain) throws javax.servlet.ServletException, java.io.IOException
doFilter
in interface javax.servlet.Filter
servletRequest
- requestservletResponse
- responsefilterChain
- filter chain
javax.servlet.ServletException
java.io.IOException
public void destroy()
destroy
in interface javax.servlet.Filter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |