struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Markus L." <>
Subject newbie issue - tiles plugin, adding content to "dynamic" attributes
Date Mon, 02 Jun 2008 17:01:01 GMT
hi list!

i'm new to struts and tiles and read a lot of docs, tutorials and lists last
few days. i think i got the basics and managed to implement some test

however, i still don't understand how to get attributes dynamic... i've seen
"runtime composition" in the ViewPreparer and DefinitionFactory, but i don't
know how to access the controller generated data from there..

following situation:

<definition name="page" template="/WEB-INF/jsp/layoutABCD.jsp">
  <put-attribute name="contentA" value="/WEB-INF/jsp/contentA.jsp" />
  <put-attribute name="contentB" value="/WEB-INF/jsp/contentB.jsp" />
  <put-attribute name="contentC" value="/WEB-INF/jsp/contentC.jsp" />
  <put-attribute name="contentD" value="/WEB-INF/jsp/contentD.jsp" />

<package name="page" namespace="/page" extends="struts-default">
      <result-type name="tiles"

    <action name="view" class="org.non.actions.PageAction" method="view">
       <result name="view" type="tiles">page</result>

contentX.jsp ( X = A, B, C, D )
<%@ taglib prefix="s" uri="/struts-tags" %>
<s:property value="page.contentX" />

what i want to do now is to have an arbitrary number of content elements (1)
and to avoid these "stub"-JSPs at all (2)...

for problem (1) i'm going to extend the DefinitionFactory, but that's for

what's more import now is problem (2):

in the ViewPreparer i can add attributes, but i don't know how to access the
action controller to fill them with data.. (as that would avoid the JSPs..)

this must be a very basic problem, so i guess someone can put me on the
right way.



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