Is it not possible to use EL in access attribute? I dislike to hardcode the role names in the tag, instead would like to use a constant. But it is throwing an exception saying:
org.apache.jasper.JasperException: abc.jsp(19,4) According to TLD or
attribute direc tive in tag file, attribute access does not accept
any expressions
Here is what I have in jsp(using unstandard taglib for constants):
<%@taglib uri="http://jakarta.apache.org/taglibs/unstandard-1.0" prefix="un"%>
<un:useConstants className="com.xxx.PrivilegeConstants" var="privilege" />
.....
<sec:authorize access="hasRole('${privilege.USER_ROLE}')"> // throwing ex here
security content here....
</sec:authorize>
Is there any other alternative? Thanks in advance...
Looks like the support was added later on. See the JIRA here. Using the version which adds this support should work, I guess.