Alachisoft NCache 4.1 - Online Documentation

Step 3: Defining Filter

 
  1. After adding the required libraries to your application, you first need to add the filter in the deployment descriptor of your web application. The class file containing the filter implementation is: com.alachisoft.ncache.web.sessionstate.NSessionStoreProvide
     
  2. To create a filter, you must define it first under the tag <filter> and then provide a URL mapping for the filter <filter-mapping>.
     
    <filter>
    <filter-name> NCacheSessionProvider </filter-name>
    <filter-class> com.alachisoft.ncache.web.sessionstate.NSessionStoreProvider</filter-class>
    </filter>
     
    <filter-mapping>
    <filter-name> NCacheSessionProvider </filter-name>
    <url-pattern> /* </url-pattern>
    </filter-mapping>
     
  3. After creating filter you need to initialize parameters to the filter. NCache Session filter can be configured with a number of initialization parameters.
     
    <init-param>
    <param-name> cacheName </param-name>
    <param-value> myCache </param-value>
    </init-param>
     
    <init-param>
    <param-name>configPath </param-name>
    <param-value>usr/local/NCache/Config/</param-value>
    </init-param>
 
 
    See Also
 
Copyright © 2005-2012 Alachisoft. All rights reserved.