Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Security taglib cannot be found

When I put <%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>

I will recieve the following error:

The absolute uri: http://www.springframework.org/security/tags cannot be resolved in either web.xml or the jar files deployed with this application 

But I have spring-security-taglibs-3.1.3 et al in my /lib folder. Does anyone know what else am I missing?

like image 328
Sy Z Avatar asked Apr 19 '13 07:04

Sy Z


People also ask

What is Spring Security Taglibs?

Spring Security has its own taglib which provides basic support for accessing security information and applying security constraints in JSPs.

How can JSPs access security information and apply security constraints provided by Spring Security?

Spring Security provides its own tags for jsp pages. These tags are used to access security information and apply security constraints in JSPs. The following tags are used to secure view layer of the application.

Which of the following tags are used to secure View layer of application in spring?

In Spring MVC applications using JSP, we can use the Spring Security tags for applying security constraints as well as for accessing security information. Spring Security Tag library provides basic support for such operations.


1 Answers

Adding this dependency fixed it for me (using 3.1.X.RELEASE) :

<dependency>     <groupId>org.springframework.security</groupId>     <artifactId>spring-security-taglibs</artifactId>     <version>${your-version}</version> </dependency> 

The taglib now works properly:

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

like image 125
Mike R Avatar answered Oct 07 '22 05:10

Mike R