RE: [SPAM] - Re: Using the iterator to list results from a hibernate join - Email has different SMTP TO: and MIME TO: fields in the email addresses

2008-07-22 Thread Brian Daddino
I did look, but I could not find it.  Do you have a link?

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 22, 2008 11:34 AM
To: Struts Users Mailing List
Subject: [SPAM] - Re: Using the iterator to list results from a
hibernate join - Email has different SMTP TO: and MIME TO: fields in the
email addresses

--- On Tue, 7/22/08, Brian Daddino [EMAIL PROTECTED] wrote:
 I'm new to Struts 2.   I have searched the web but can
 not find anything on my issue.

Did you look at the S2 documentation wiki? It answers these questions.

 What do I put in the value field of my property tag?

Here's some pseudo-code based loosely on your requirements.

s:property contact.name/
s:iterator value=contact.contacts
  s:property value=email/
  s:property value=phone/
/s:iterator

The contact is exposed by the action.

The s:property.../ tags call, in this example, getEmail() on each
object being iterated over. An alternative way would be:

s:iterator value=contact.contacts id=aContact
  s:property value=#aContact.email/
  s:property value=#aCotnact.phone/
/s:iterator

I'd recommend looking over some of the basics on the S2 wiki.

Dave


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



This electronic transmission may contain PRIVILEGED AND CONFIDENTIAL 
information intended only for the addressee(s).  If you are not the intended 
recipient, or the employee or agent responsible for delivery to the intended 
recipient(s), please note that any review, dissemination, use, distribution or 
copying is strictly prohibited.  If you receive this in error, please notify 
the sender immediately, destroy any paper copies and delete it from any 
computer.  Thank you.


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



RE: [SPAM] - Re: Using the iterator to list results from a hibernate join - Email has different SMTP TO: and MIME TO: fields in the email addresses

2008-07-22 Thread Dave Newton
--- On Tue, 7/22/08, Brian Daddino [EMAIL PROTECTED] wrote:
 I did look, but I could not find it.  Do you have a link?

http://struts.apache.org/2.x/docs/home.html

Dave


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



RE: [SPAM] - Re: Using the iterator to list results from a hibernate join - Email has different SMTP TO: and MIME TO: fields in the email addresses

2008-07-22 Thread Brian Daddino
Thanks for the link.  I did find a method that somewhat works in
there...
Instead of making my join in the query, I am just querying out my
contacts and using 2 iterators...
s:iterator value=contacts  status=status
s:iterator value=contactmethodses  status=status
tr
td class=nowraps:property value=firstName//td
td class=nowraps:property value=lastName//td
td class=nowraps:property value=method//td
...


This works fairly well, but loses my outer join (if there is no contact
method, the contact's name is not even displayed).  
Am I missing something still?


-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 22, 2008 12:09 PM
To: Struts Users Mailing List
Subject: RE: [SPAM] - Re: Using the iterator to list results from a
hibernate join - Email has different SMTP TO: and MIME TO: fields in the
email addresses

--- On Tue, 7/22/08, Brian Daddino [EMAIL PROTECTED] wrote:
 I did look, but I could not find it.  Do you have a link?

http://struts.apache.org/2.x/docs/home.html

Dave


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



This electronic transmission may contain PRIVILEGED AND CONFIDENTIAL 
information intended only for the addressee(s).  If you are not the intended 
recipient, or the employee or agent responsible for delivery to the intended 
recipient(s), please note that any review, dissemination, use, distribution or 
copying is strictly prohibited.  If you receive this in error, please notify 
the sender immediately, destroy any paper copies and delete it from any 
computer.  Thank you.


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



RE: [SPAM] - Re: Using the iterator to list results from a hibernate join - Email has different SMTP TO: and MIME TO: fields in the email addresses

2008-07-22 Thread Brian Daddino
I spoke too soon.
Thanks you're your help...
If anyone else needs the answer what I did was




s:iterator value=contacts2  status=status id=test
tr
s:iterator value=test  status=status

td class=nowraps:property value=firstName//td
td class=nowraps:property value=lastName//td
td class=nowraps:property value=method//td
td class=nowraps:property value=value//td
td fill space /td

/s:iterator
/tr
/s:iterator


-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 22, 2008 12:09 PM
To: Struts Users Mailing List
Subject: RE: [SPAM] - Re: Using the iterator to list results from a
hibernate join - Email has different SMTP TO: and MIME TO: fields in the
email addresses

--- On Tue, 7/22/08, Brian Daddino [EMAIL PROTECTED] wrote:
 I did look, but I could not find it.  Do you have a link?

http://struts.apache.org/2.x/docs/home.html

Dave


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



This electronic transmission may contain PRIVILEGED AND CONFIDENTIAL 
information intended only for the addressee(s).  If you are not the intended 
recipient, or the employee or agent responsible for delivery to the intended 
recipient(s), please note that any review, dissemination, use, distribution or 
copying is strictly prohibited.  If you receive this in error, please notify 
the sender immediately, destroy any paper copies and delete it from any 
computer.  Thank you.


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



RE: [SPAM] - Re: Using the iterator to list results from a hibernate join - Email has different SMTP TO: and MIME TO: fields in the email addresses

2008-07-22 Thread Dave Newton
--- On Tue, 7/22/08, Brian Daddino wrote:
 Instead of making my join in the query, I am just querying
 out my contacts and using 2 iterators...
 s:iterator value=contacts status=status
   s:iterator value=contactmethodses status=status
 s:property value=firstName/
 s:property value=lastName/
 s:property value=method/
 ...
 
 This works fairly well, but loses my outer join (if there
 is no contact method, the contact's name is not even displayed).
 Am I missing something still?

Most likely :)

First of all, you're iterating over two sets of things: contacts, and contact 
methods.

The iterator tag [1] works by pushing each object of iteration onto the top of 
the stack. The property tag [2] will call the getter on the object on the top 
of the stack (actually, I thought it'd keep going down the stack; I could be 
remembering incorrectly though).

You have two iterators; once you're inside the second iterator the contact is 
no longer on the top of the stack--the contact method is (if there *are* any 
contact methods). That can be solved by providing an id attribute, thus 
naming the object of iteration, and allowing you to refer to it regardless of 
stack depth. The pseudo-code I provided demonstrated this.

Second of all, your current implementation only displays properties if there 
are contactmethodses (your pluralizer needs help). The pseudo-code I provided 
printed the contact name *then* iterated over contactmethodses.

On a pedantic note, your outer join isn't being lost, nor is data loading 
methodology relevant.

Dave

[1] Iterator tag: http://struts.apache.org/2.x/docs/iterator.html
[2] Property tag: http://struts.apache.org/2.x/docs/property.html


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