tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Heinen <michael.hei...@recommind.com>
Subject migration to tiles2 - put attribute into request scope?
Date Sun, 03 Jan 2010 16:45:24 GMT
Hi,

I migrated a webApp from tiles1 to tiles 2.0.5 and got one thing not working.
I cannot put an attribute into request scope to make it accessible by other frameworks.

Sample code is below: It is the attribute with name=activeTab, which should be accessible
in navigation.jsp.

tiles 1:
<definition name=".mainLayout" path="/WEB-INF/layout/main.jsp">
    <put name="header" value="/WEB-INF/layout/header.jsp"/>
    <put name="navigation" value="/pages/empty.jsp"/>
    <put name="content" value="/pages/empty.jsp"/>
    <put name="activeTab" value=""/>
</definition>

<definition name="/batches.tiles" extends=".mainLayout">
    <put name="navigation" value="/WEB-INF/layout/navigation.jsp"/>
    <put name="content" value="/pages/bcontent.jsp"/>
    <put name="activeTab" value="ba"/>
</definition>

main.jsp:
<tiles:insert attribute="navigation" flush="false" ignore="false">
  <tiles:put name="activeTab" beanName="activeTab"/>
</tiles:insert>

navigation.jsp
<tiles:useAttribute id="activeTab" name="activeTab" ignore="true" classname="java.lang.String"
scope="request"/>


tiles2:
<definition name=".mainLayout" template="/WEB-INF/layout/main.jsp">
    <put-attribute name="header" value="/WEB-INF/layout/header.jsp"/>
    <put-attribute name="navigation" value="/pages/empty.jsp"/>
    <put-attribute name="content" value="/pages/empty.jsp"/>
    <put-attribute name="activeTab" value=""/>
</definition>

<definition name="/batches.tiles" extends=".mainLayout">
    <put-attribute name="navigation" value="/WEB-INF/layout/navigation.jsp"/>
    <put-attribute name="content" value="/pages/bcontent.jsp"/>
    <put-attribute name="activeTab" value="ba"/>
</definition>

main.jsp:
<tiles:insertAttribute name="navigation" flush="false" ignore="false">
  <tiles:putAttribute name="activeTab" value="activeTab"/>
</tiles:insertAttribute>

navigation.jsp
<tiles:useAttribute id="activeTab" name="activeTab" ignore="true" classname="java.lang.String"
scope="request"/>

How can I place the content of activeTab (here "ba") into request scope to make it accessible
by other frameworks?
Currently the String "activeTab" is passed but I want to pass "ba".

Sorry for crossposting this also to the struts list, email was sent too fast with auto completion
of recipient.

Thanks,
Michael


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message