Ray,

>From your code examples, it seems like you are using struts-el and
struts-tiles-el.  Is this correct?  If so I can make suggestions but I can't
test it (not using them - I have JSP 2.0 in my Tomcat 5.0.2? + STruts v1.2.4
setup).

HOWEVER, I have a few well-directed questions that might explain your
issue(s):

I see you have done logging but have you done them with the iterated names
to be 100% sure they are loaded? Such as:

(your loop here)
      request.setAttribute ( department.getItem ( ), departments );
        System.out.println ( "Department: " + department.getItem ( ) + ",
collection: " + departments );

I see you are saving the "departments" object to the request, not the
"department".  Yet in your tile:put you are trying to put
departments.getItem().  Is there such a thing or did you mean to save the
"department" object so your tile:put could do a department.getItem().  From
the code you included (see next line), I'm expecting there to be JSP errors
or something logged because I can't see how it could exist - how can the
collection have a string getItem() method unless you extended the collection
Interface?  This makes me think the objects are NOT being loaded properly
from this JSP tile call:

<tile:put name='organization' beanName='${department.item}'
beanScope='request'/>

You should do the same full logging/printing in your JSP as I recommended in
your Action class.  You should be able to import all direct Tile variables
using a generic tile:importAttribute tag:

<tile:importAttribute>

Then you could manually check that the JSP can see them using something like
this (it's late so don't penalize me for bad coding if this isn't the exact
syntax):

<bean:write name="Automotive" property="item"/><br>
<bean:write name="organization" property="item"/><br>

I hope these directed questions help point you in the right direction with
your debugging.

Regards,
David

-----Original Message-----
From: Ray Madigan [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 20, 2004 2:52 PM
To: Struts Users Mailing List
Subject: RE: Tiles Question


The action Looks like this

  Collection depList = getDepartmentList ( );
  Iterator itor = depList.iterator ( );
  while ( itor.hasNext ( ) ) {
      txDepartment department = ( txDepartment ) itor.next ( );
      Collection departments = getOrganizationData ( department.getItem
( ) );
      request.setAttribute ( department.getItem ( ), departments );
      // I can iterate over the departments collection and get the right
information
      // System.out.println ( "Department: " + department.getItem ( ) );
      // Yields Department: Automotive
      // Among others
  }

The starting JSP is

  <table class="content" border="0" cellspacing="10" cellpadding="0">
  <c:forEach var='department' items='${departments}'>
    <tr><td align="center">
        <table class="border" border="0" cellspacing="0" cellpadding="1">
            <tile:insert page='/Department.jsp'>
              <tile:put name='organization' beanName='${department.item}'
beanScope='request'/>
            </tile:insert>
        </table>
    </td></tr>
  <c:forEach>
  </Table>

If I change the put value to 'Automotive'  It works for that case like
              <tile:put name='organization' beanName='Automotive'
beanScope='request'/>
The Department.jsp looks like

<tile importAttribute name='organization'/>

<c:forEach var='org' items='${organization}'>
   <c:out value='${org.manager}'/>
</c:forEach>

The generated error is:
importAttribute : property 'organization' not found in context. Check tag
syntax'

-----Original Message-----
From: David G. Friedman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 20, 2004 8:41 AM
To: Struts Users Mailing List
Subject: RE: Tiles Question


Ray,

Do you have an example of your tile definitions and stub pages I can look
at?

Regards,
David

-----Original Message-----
From: Ray Madigan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 19, 2004 6:05 PM
To: 'Struts Users Mailing List'
Subject: Tiles Question


I am trying to pass an attribute to a tile as follows:

<tile:insert ...
  <tile:put name='offer' beanName='${foo.name}' beanScope='request'/>
..
</tile:insert>

And
foo.getName ( ).equals ( "Adventure" )
And I have verified a requestAttribute was added.

in the tile when i do

<tile:importAttribute name='offer'/>

I get the message

importAttribute : property 'offer' not found in context. Check tag syntax'

---------------------------------------------------------------------
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]


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