This is a Java servlet filter (as per Servlet API 2.3). This filter lets you quickly deploy access restriction rules for your resources. Simply map this filter to resources you are going to protect and provide authorization rules right in filter's parameters. How to use it: a) download authflt.jar and save it in WEB-INF/lib b) describe this filter in web.xml. You may provide the following initial parameters:
for example:
<filter> <filter-name>AuthFilter</filter-name> <filter-class>com.cj.auth.AuthFilter</filter-class> <init-param> <param-name>name</param-name> <param-value>guest</param-value> </init-param> <init-param> <param-name>password</param-name> <param-value>12345</param-value> </init-param> </filter> c) describe a mapping for this filter in web.xml. E.g.:
<filter-mapping> <filter-name>AuthFilter</filter-name> <url-pattern>/closed/*.jsp</url-pattern> </filter-mapping> in this example filter will be on for the each .jsp file in /closed sub-directory.
So for the each request for .jsp file from that directory filter will check out authorization
settings (user name: guest, password: 12345) and popup authorization dialogue if nessecory.
For downloading: Authorization filter: authflt.jar
See also JSOS - the largest collection of servlets and filters.
|
Also in JSOS:
|