struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Heinen <michael.hei...@recommind.com>
Subject RE: migration to tiles2 - put attribute into request scope?
Date Mon, 04 Jan 2010 08:21:09 GMT
I sent this tiles issue the wrong list.

Sorry for crossposting to struts and tiles.



BTW:

Got it working with an additional import statement:



Main.jsp

<tiles:importAttribute  name="activeTab" scope="request"/>

<tiles:insertAttribute name="navigation" flush="false" ignore="false"/>



<tiles:useAttribute is also not required any more in navigation.jsp.



Michael


From: Michael Heinen
Sent: Sonntag, 3. Januar 2010 17:24
To: 'user@struts.apache.org'
Subject: migration to tiles2 - put attribute into request scope?

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

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

Thanks,
Michael

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