Installing Deadbolt

Overview

Installation of Deadbolt is simple.

  1. Install the Deadbolt JAR into your application
  2. Install the filter into your web.xml
  3. Install the tag library
  4. Install the Deadbolt descriptor

1. Install the Deadbolt JAR

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:

  • Put the JAR in the "lib" directory of your application's WEB-INF directory
  • Put the JAR in your application server's common library location. For example, in Tomcat you could put the file in %TOMCAT_HOME%/common/lib .
  • Put the JAR anywhere and add the path to your CLASSPATH environment variable
It's recommended that you either put the JAR in your application or on the application server. If you choose to put the JAR in your application server, you'll have to remember to migrate it to your other environments when you create releases of your application.

2. Install the Deadbolt filter

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>
				

3. Install the Deadbolt tag library

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>
				

4. Install the Deadbolt descriptor

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!