jsp - Spring security tags do not work in error pages -


i have custom error pages each error code wish handle, though i'm finding spring-security tags not working when using these pages. example, below "one" shows:

<%@ page session="false" %> <%@ taglib uri="http://www.springframework.org/security/tags" prefix="sec" %> <p>one</p> <sec:authorize access="isauthenticated()">   <p>two</p> </sec:authorize> <sec:authorize access="!isauthenticated()">   <p>three</p> </sec:authorize> 

specifically targeting error pages provided web.xml, i.e.

<error-page>   <error-code>404</error-code>   <location>/web-inf/error/404-layout.jsp</location> </error-page> 

in controller throw runtimeexception called resourcenotfoundexception annotated @responsestatus(value = httpstatus.not_found) entities not found. redirects error page correctly.

what doesn't work what's explained above, within spring security tag not render, whether resulting true or false, illustrated in example, both tags produce no output.

the tags "work" (you should clarify mean "not working") if page rendered request passes through spring security filter chain.

the error pages declare in web.xml handled directly container and, far know, there's no way tell apply filter-mapping them.


Comments