Stripes

Nested layout-render with freemarker renders in incorrect order

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Not a Bug
  • Affects Version/s: Release 1.4.3
  • Fix Version/s: None
  • Component/s: Formatting
  • Labels:
    None
  • Environment:
    tomact6

Description

Apologies if this is a freemarker bug, but certainly an issue when using freemarker with stripes.

nested use of layout-render is provided as similar to the following:

HelloWorld.jsp

<stripes:layout-render name="/render_test/default.jsp" pageTitle="Using A Layout">
<stripes:layout-component name="contents">
<stripes:layout-render name="/render_test/nested.jsp"/>
</stripes:layout-component>
</stripes:layout-render>

default.jsp

<stripes:layout-definition>
<html>
<head>
<title>Examples: ${pageTitle}</title>
</head>
<body>
start<br/><br/>
before component<br/>
<stripes:layout-component name="contents"/>
after component<br/><br/>
</body>
</html>
</stripes:layout-definition>


nested.jsp

<stripes:layout-definition>
Nested Layout Definition<br/>
</stripes:layout-definition>

This renders correctly as the following:
----------------
start

before component
Nested Layout Definition
after component
------------------

This is correct! hurray!

Now try the same using freemarker:

HelloWorld.ftl

ftl
[#assign s=JspTaglibs["http://stripes.sourceforge.net/stripes.tld"]]
[@s["layout-render"] name="/render_test/default.jsp" pageTitle="Using A Layout"]
[@s["layout-component"] name="contents"]
[@s["layout-render"] name="/render_test/nested.ftl"][/@]
[/@]
[/@]

default.ftl

ftl
[#assign s=JspTaglibs["http://stripes.sourceforge.net/stripes.tld"]]
[@s["layout-definition"]]
<html>
<head>
<title>Examples: ${pageTitle}</title>
</head>
<body>
start<br/><br/>
before component<br/>
[@s["layout-component"] name="contents" /]
after component<br/><br/>
</body>
</html>
[/@]

nested.ftl

ftl
[#assign s=JspTaglibs["http://stripes.sourceforge.net/stripes.tld"]]
[@s["layout-definition"]]
Nested Layout Definition<br/>
[/@]

This renders the following:
----------
Nested Layout Definition
start

before component
after component
----------

As you can see, it renders incorrectly. Perhaps a freemarker bug, but please advise.
Thanks

Activity

Hide
Frederic Daoud added a comment - 19/Apr/11 3:11 PM

FreeMarker issue.

Show
Frederic Daoud added a comment - 19/Apr/11 3:11 PM FreeMarker issue.

People

Vote (0)
Watch (1)

Dates

  • Created:
    23/Apr/08 10:55 AM
    Updated:
    19/Apr/11 3:11 PM
    Resolved:
    19/Apr/11 3:11 PM