Thad,

How are you calling the action?

Jeremy
-----Original Message-----
From: Thad Humphries [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 17, 2004 5:36 PM
To: [EMAIL PROTECTED]
Subject: passing beans to tiles


I'm trying to move a simple test application to tiles but I cannot get a list 
of object from my servlet to the tile.  It works without tiles.

In struts-config.xml I have

    <form-bean 
        name="screenListForm"
        dynamic="true"
        type="org.apache.struts.action.DynaActionForm">
      <form-property name="screens" type="java.util.List"/>
    </form-bean>    
... 
    <action
        path="/getscreenlist"
        type="com.optix.struts.action.GetScreenListAction"
        scope="request"
        name="screenListForm"
        validate="false">
      <forward name="Success" path="/screenList.jsp"/>
    </action>
 
In screenList.jsp, I have

<logic:iterate name="screenListForm" property="screens" id="screenRec">
<p class="dbscreen">
<html:link paramName="screenRec" 
    paramProperty="screenName" paramId="screenName" 
    paramScope="page"  href="getscreen?" >
<bean:write name="screenRec" property="screenName"/>
</html:link>
</p>
</logic:iterate>

As I said, the above approach works.  Now, trying tiles, if I create this 
layout/webDefault.jsp

  <tiles:insert attribute="header" />
  <tiles:insert attribute="menu" />
  <tiles:insert attribute="body">
  <tiles:insert attribute="footer" />

and a new screenList.jsp

<tiles:insert page="/layouts/webDefault.jsp" flush="true" ignore="true">
  <tiles:put name="header" value="/common/header.jsp" />
  <tiles:put name="menu"   value="ignored" />
  <tiles:put name="body"   value="/bodies/screenList-body.jsp" />
  <tiles:put name="footer" value="/common/footer.jsp" />
</tiles:insert>

and /bodies/screenList-body.jsp as the meat of my original screenList.jsp 
above, I'm getting  "[ServletException in:/bodies/screenList-body.jsp] Cannot 
find bean screenRec in scope page' "

I've tried various tiles tags such as useAttribute, etc but no good.  What 
does it take to get my servlet to my JSP?

Also, can someone point out some **real** tiles examples?  Most I see are too 
simplistic to be useful.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to