velosurf.util
Class TemplateNameFilter

java.lang.Object
  extended by velosurf.util.TemplateNameFilter
All Implemented Interfaces:
javax.servlet.Filter

Deprecated.

@Deprecated
public class TemplateNameFilter
extends java.lang.Object
implements javax.servlet.Filter

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:

Author:
Claude Brisson

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

servletContext

private javax.servlet.ServletContext servletContext
Deprecated. 
the servlet context.


templateExtension

private java.lang.String templateExtension
Deprecated. 
targeted template extension.


RESET_NONE

private static final int RESET_NONE
Deprecated. 
NONE reset method.

See Also:
Constant Field Values

RESET_MANUAL

private static final int RESET_MANUAL
Deprecated. 
MANUAL reset method.

See Also:
Constant Field Values

RESET_PERIODIC

private static final int RESET_PERIODIC
Deprecated. 
PERIODIC reset method.

See Also:
Constant Field Values

resetMethod

private int resetMethod
Deprecated. 
reset method.


resetUri

private java.lang.String resetUri
Deprecated. 
reset uri.


resetPeriod

private long resetPeriod
Deprecated. 
reset period.


templates

private java.util.Set<java.lang.String> templates
Deprecated. 

lastReset

private long lastReset
Deprecated. 
Constructor Detail

TemplateNameFilter

public TemplateNameFilter()
Deprecated. 
Method Detail

init

public void init(javax.servlet.FilterConfig filterConfig)
          throws javax.servlet.ServletException
Deprecated. 
init the filter.

Specified by:
init in interface javax.servlet.Filter
Parameters:
filterConfig - filter configuration
Throws:
javax.servlet.ServletException

buildsTemplateNamesList

private void buildsTemplateNamesList(javax.servlet.http.HttpServletResponse response)
Deprecated. 
Build the cache, which consists of a hash set containing all template names.


doFilter

public void doFilter(javax.servlet.ServletRequest servletRequest,
                     javax.servlet.ServletResponse servletResponse,
                     javax.servlet.FilterChain filterChain)
              throws javax.servlet.ServletException,
                     java.io.IOException
Deprecated. 
doFilter method.

Specified by:
doFilter in interface javax.servlet.Filter
Parameters:
servletRequest - request
servletResponse - response
filterChain - filter chain
Throws:
javax.servlet.ServletException
java.io.IOException

destroy

public void destroy()
Deprecated. 
Destroy the filter.

Specified by:
destroy in interface javax.servlet.Filter


~ooOoo~