6

我想在site-mesh的装饰器文件中使用spring security标签库的一些标签。但是,这些标签中的内容永远不会显示。谁能告诉我这是为什么?

代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<%@taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<!--HTML-->
     <form id="login_form" method="post" action="<c:url value='j_spring_security_check'/>">
      <sec:authorize access="isAuthenticated()">
       <p>profile</p>
       <p>messages</p>
      </sec:authorize>
      <sec:authorize access="isAnonymous()">

       <!--A Login form -->
      </sec:authorize>
     </form>
<!--More HTML -->
</html>

由于某种原因,两个块都没有显示。

4

1 回答 1

22

我想您需要在过滤器链中的 Spring Security 过滤器之后放置 Sitemesh 过滤器,即相应地对它们<filter-mapping>的 s 进行web.xml排序。

于 2010-12-06T20:45:28.017 回答