【问题标题】:Spring security tags in sitemesh decoratorsitemesh 装饰器中的 Spring 安全标签
【发布时间】:2011-05-21 05:10:16
【问题描述】:

我想在site-mesh的decorator文件中使用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>

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

【问题讨论】:

    标签: java jsp struts spring-security sitemesh


    【解决方案1】:

    我猜你需要在过滤器链中的 Spring Security 过滤器之后放置 Sitemesh 过滤器,即相应地在 web.xml 中排序它们的 &lt;filter-mapping&gt;s。

    【讨论】:

    • 小时搜索这么愚蠢的东西。我可以告诉大多数人根本不会要求站点网格。好家伙。
    猜你喜欢
    • 2013-08-02
    • 2011-02-20
    • 2013-08-25
    • 2011-12-24
    • 2014-02-14
    • 2013-03-01
    • 2011-04-26
    • 1970-01-01
    • 2017-09-21
    相关资源
    最近更新 更多