views:

47

answers:

1

Hello, 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

A: 

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">
Zenithar