Installation of Deadbolt is simple.
Once you've downloaded the Deadbolt release, you need to install the library into your web application or classpath. This can be done in several ways:
WEB-INF
directory
%TOMCAT_HOME%/common/lib
.
CLASSPATH
environment variable
The starting point of Deadbolt is the Deadbolt
filter. This needs to be added to your application's
web.xml
file.
Add the following bold lines to your
WEB-INF/web.xml
file:
<web-app...> ... <filter> <filter-name>DeadboltFilter</filter-name> <filter-class>net.sf.deadbolt.DeadboltFilter</filter-class> <init-param> <param-name>config-file</param-name> <param-value> /WEB-INF/deadbolt-config.xml </param-value> </init-param> </filter> <filter-mapping> <filter-name>DeadboltFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> ... </web-app>
If you want to use the Deadbolt JSP custom tags in
your code, you need to add the Tag Library
Descriptor file and add a reference to it in your
web.xml
.
NOTE:
This is only required if you want to use the custom
tags.
Copy the
deadbolt.tld
file to your application's
/WEB-INF/taglibs
directory. You can put this somewhere else, but be
sure to reference the correct location in in the
taglib
element of your
web.xml
below.
Add the following bold lines to your
WEB-INF/web.xml
file:
<web-app...> ... <taglib> <taglib-uri>deadbolt</taglib-uri> <taglib-location>/WEB-INF/taglibs/deadbolt.tld</taglib-location> </taglib> ... </web-app>
The Deadbolt descriptor is the central controller
for Deadbolt. This is where you will make changes to
your application's security scheme. Copy
deadbolt-config.xml
to your application's
WEB-INF
directory.
Okay, you're all set to start using Deadbolt!