Tag Libraries

Spring Security comes bundled with several JSP tag libraries which provide a range of different services.

Configuration

All taglib classes are included in the core spring-security-xx.jar file, with the security.tld located in the JAR's META-INF directory. This means for JSP 1.2+ web containers you can simply include the JAR in the WAR's WEB-INF/lib directory and it will be available. If you're using a JSP 1.1 container, you'll need to declare the JSP taglib in your web.xml file, and include security.tld in the WEB-INF/lib directory. The following fragment is added to web.xml:

<taglib>
  <taglib-uri>http://www.springframework.org/security/tags</taglib-uri> 
  <taglib-location>/WEB-INF/security.tld</taglib-location>
</taglib>

Usage

Now that you've configured the tag libraries, refer to the individual reference guide sections for details on how to use them. Note that when using the tags, you should include the taglib reference in your JSP:

  <%@ taglib prefix='security' uri='http://www.springframework.org/security/tags' %>