6

site-meshのデコレータファイル内でSpringセキュリティタグライブラリのいくつかのタグを使用したいと思います。ただし、これらのタグ内のコンテンツは表示されません。なぜこれなのか誰か教えてもらえますか?

コード:

<!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 に答える