当 Apache Tiles 2.1 在必须做的时候不做任何事情时该怎么办?

发布于 2024-09-12 11:02:57 字数 1579 浏览 5 评论 0原文

读者(女孩)和读者(男孩),

我对 Apache Tiles 2.1 有一个轻微的 f%*#@problem,我使用的是:

  • Struts 2.1.8.1
  • Apache Tiles 2.1
  • Spring 3.0.3
  • Spring Security 3.0.3

我的问题是:Apache Tiles 不适用于每个 JSP,这似乎有问题

<tiles:insertAttribute name="body" />

This insert no data。当我看到生成的结果时,我可以看到:

<table id="tilecontent">
    <tr>
         <sec:authorize access="hasRole('USER') and !hasRole('TESTER')"> 
            <td class="menu">
            <div id="nav"><tiles:insertAttribute name="menu" ignore="false"/></div>
            </td>
         </sec:authorize>
        <td>
        <div id="targetSynthese">

        <div id="ariane"><tiles:insertDefinition name="ariane" ignore="false"/></div>
        <table>
            <tr>
                <td class="errorMessage autoHeight"><tiles:insertDefinition name="error" /></td>
            </tr>
            <tr>
                <td><tiles:insertAttribute name="body" ignore="false"/></td>
            </tr>
        </table>
        </div>
        </td>
    </tr>
</table>

但是当我刷新页面时,页面已加载并且也已平铺。

问题来自于“菜单”图块中 sx:a 的使用,当我删除它们时,页面第一次正确加载。

是否可以与 Spring Security 进行交互?

问候, 谢谢大家。

编辑:Struts 2 JIRA https://issues.apache.org/jira/browse/WW -2950

readers (girl) and readers (boy),

I have a slighly f%*#@ probelm with Apache Tiles 2.1, I work with :

  • Struts 2.1.8.1
  • Apache Tiles 2.1
  • Spring 3.0.3
  • Spring Security 3.0.3

My problem is : Apache Tiles does not work on each JSPs, it seems to have problem with

<tiles:insertAttribute name="body" />

This insert no data. When i see the generated result i can see :

<table id="tilecontent">
    <tr>
         <sec:authorize access="hasRole('USER') and !hasRole('TESTER')"> 
            <td class="menu">
            <div id="nav"><tiles:insertAttribute name="menu" ignore="false"/></div>
            </td>
         </sec:authorize>
        <td>
        <div id="targetSynthese">

        <div id="ariane"><tiles:insertDefinition name="ariane" ignore="false"/></div>
        <table>
            <tr>
                <td class="errorMessage autoHeight"><tiles:insertDefinition name="error" /></td>
            </tr>
            <tr>
                <td><tiles:insertAttribute name="body" ignore="false"/></td>
            </tr>
        </table>
        </div>
        </td>
    </tr>
</table>

But when i refresh the page is loaded and tiles too.

The problem come from usage of sx:a in the "menu" tiles, when i remove them the page loaded correctly on the first time.

Are there any interactions possible with spring security ?

Regards,
Thanks for all.

EDIT : Struts 2 JIRA https://issues.apache.org/jira/browse/WW-2950

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小镇女孩 2024-09-19 11:02:57

我已经解决了我的问题。它似乎是由Spring Security引入的,

我已经删除了过滤调度程序中的INCLUDE:

<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <!-- <dispatcher>INCLUDE</dispatcher> -->
    <dispatcher>FORWARD</dispatcher>
</filter-mapping>

并将once-per-request =“false”添加到我的applicationContext

<sec:http access-denied-page="/accessDenied.jsp"
    use-expressions="true" auto-config="false"
    entry-point-ref="authenticationProcessingFilterEntryPoint"
    lowercase-comparisons="false" **once-per-request="false"** realm="Pouet">

I have resolved my problem. It seems to be introduced by Spring Security

I have removed INCLUDE in filtering dispatcher :

<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <!-- <dispatcher>INCLUDE</dispatcher> -->
    <dispatcher>FORWARD</dispatcher>
</filter-mapping>

And add once-per-request="false" to my applicationContext

<sec:http access-denied-page="/accessDenied.jsp"
    use-expressions="true" auto-config="false"
    entry-point-ref="authenticationProcessingFilterEntryPoint"
    lowercase-comparisons="false" **once-per-request="false"** realm="Pouet">
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文