I have an error page which is displayed when a 404 response status is returned.
This page is generated thanks to a template mechanism (I use tiles); In this template, I have a header that contains something like that :
<sec:authorize access="isAnonymous()">
blabla
</sec:authorize>
<sec:authorize access="isAuthenticated()">
blibli
</sec:authorize>
So, depending on if the user is authenticated, it displays blibli or blabla. This code works for all pages that use this template except for my 404 page! It displays nothing!
Any idea??
I’ll bet that problem lies in how you define
filter-mappinginweb.xml. Most common configuration is:This maps filter to all URLs, but only when they accessed by
REQUESTmethod. All other cases (likeINCLUDE,FORWARDandERROR) not catched by this filter. So to bind filter toERRORrequests, define it asTry it. If not works then add
<dispatcher>INCLUDE</dispatcher>because Tiles, probably includes pages by this way.See also:
Dispatcher for Filter Mapping
Specifying Filter Mappings