In the real code I store both the department and departments collections.

I am still using tomcat 4.1.24 and haven't moved to 5.x for similar reasons.

I just downloaded struts 1.2.4 and we will see how that works.

Thanks again for all of your help.

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


I only mentioned the struts-tiles-el.tld because I didn't think the Tiles
tags were "el" compatible.  I found a struts-tiles-el.tld in 1.2.4 not in an
old 1.1-b3 I have archived on my computer.  Are you by any chance using a
container like Tomcat 5.X.X which has native EL support so that would work?
What about the departments.getItem() collection question?  Is it the right
object you want stored?

Regards,
David

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


Well - I looked all over for a struts-tiles-el tld and couldn't find one.  I
suspected that the support was native.  I am still using struts 1.1 and
haven't moved to struts 1.2.  I see that I need to move to the new release.

Like any project with deadlines, moving to a new release is costly, I was
hoping to move after this project.  Oh well, I guess it calls for an all
nighter!

Thanks for your help, and I will let you know how it goes.

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


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]


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