Re: Need help on logic:iterate

2002-01-31 Thread marco volpe

hi
you can go here:

http://jakarta.apache.org/struts/api-1.0/org/apache/struts/taglib/logic/pack
age-summary.html


- Original Message -
From: Sher_A [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 31, 2002 3:36 PM
Subject: Need help on logic:iterate


 Can someone help me with this logic:iterate question? Thanks.

 Struts example command:
 logic:iterate id=subscription name=user
 property=subscriptions

 I read it as:
 user is the bean, user.subscriptions is a Collection
 (Vector or Array) in that bean, and each element in the Collection
 will be referenced as subscription.

 If that's correct, why am I getting this error:

 javax.servlet.ServletException: Cannot find bean jobRequest in scope
 null

 for the commands:

 logic:iterate id=jobRequest name=user property=schedule
 scope=session
   tdbean:write name=jobRequest property=name
 filter=true//td
 /logic:iterate

 Since there's no error on the iterate command, I assume that Struts did
find
 the bean user and the property schedule.
 Why then did it not find jobRequest? And why was Struts looking in scope
 null?
 Shouldn't the bean jobRequest be in the same scope as user?

 Appreciate any help.


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



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




Re: Need help on logic:iterate

2002-01-31 Thread Brian Holzer

This is only a debugging type suggestion, but you could put your interate inside of a 
logic:present name=user property=schedule 
SCHEDULE WAS FOUND
 your iterate
 /logic:present  tag and make sure that the collection is being 
found.

Brian

 [EMAIL PROTECTED] 01/31/02 08:36am 
Can someone help me with this logic:iterate question? Thanks.

Struts example command:
logic:iterate id=subscription name=user
property=subscriptions

I read it as:
user is the bean, user.subscriptions is a Collection
(Vector or Array) in that bean, and each element in the Collection
will be referenced as subscription.

If that's correct, why am I getting this error:

javax.servlet.ServletException: Cannot find bean jobRequest in scope
null

for the commands:

logic:iterate id=jobRequest name=user property=schedule
scope=session
  tdbean:write name=jobRequest property=name
filter=true//td
/logic:iterate

Since there's no error on the iterate command, I assume that Struts did find
the bean user and the property schedule.
Why then did it not find jobRequest? And why was Struts looking in scope
null?
Shouldn't the bean jobRequest be in the same scope as user?

Appreciate any help.


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



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




Re: Need help on logic:iterate

2002-01-31 Thread Philippe Hodapp / 1genia

Hi,
Yes user is your bean.
Have you send it in a session context with
session.setAttribute(user,variable)   in your Action Class ?


Philippe Hodapp
Responsable PĂ´le DĂ©veloppement
1Genia - Groupe 2Is
76, av Edouard Vaillant, 92100 Boulogne
Tel : 01 48 25 76 05
Fax : 01 48 25 11 47
GSM : 06 20 15 32 61
http://www.1genia.com


- Original Message -
From: Sher_A [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 31, 2002 3:36 PM
Subject: Need help on logic:iterate


 Can someone help me with this logic:iterate question? Thanks.

 Struts example command:
 logic:iterate id=subscription name=user
 property=subscriptions

 I read it as:
 user is the bean, user.subscriptions is a Collection
 (Vector or Array) in that bean, and each element in the Collection
 will be referenced as subscription.

 If that's correct, why am I getting this error:

 javax.servlet.ServletException: Cannot find bean jobRequest in scope
 null

 for the commands:

 logic:iterate id=jobRequest name=user property=schedule
 scope=session
   tdbean:write name=jobRequest property=name
 filter=true//td
 /logic:iterate

 Since there's no error on the iterate command, I assume that Struts did
find
 the bean user and the property schedule.
 Why then did it not find jobRequest? And why was Struts looking in scope
 null?
 Shouldn't the bean jobRequest be in the same scope as user?

 Appreciate any help.


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



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




RE: Need help on logic:iterate

2002-01-31 Thread Greg Hess

Because you havent included the %@ taglib uri=/WEB-INF/struts-logic.tld
prefix=logic % page directive in the current jsp page.

-Original Message-
From: marco volpe [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 31, 2002 10:02 AM
To: Struts Users Mailing List
Subject: Re: Need help on logic:iterate


hi
you can go here:

http://jakarta.apache.org/struts/api-1.0/org/apache/struts/taglib/logic/pack
age-summary.html


- Original Message -
From: Sher_A [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 31, 2002 3:36 PM
Subject: Need help on logic:iterate


 Can someone help me with this logic:iterate question? Thanks.

 Struts example command:
 logic:iterate id=subscription name=user
 property=subscriptions

 I read it as:
 user is the bean, user.subscriptions is a Collection
 (Vector or Array) in that bean, and each element in the Collection
 will be referenced as subscription.

 If that's correct, why am I getting this error:

 javax.servlet.ServletException: Cannot find bean jobRequest in scope
 null

 for the commands:

 logic:iterate id=jobRequest name=user property=schedule
 scope=session
   tdbean:write name=jobRequest property=name
 filter=true//td
 /logic:iterate

 Since there's no error on the iterate command, I assume that Struts did
find
 the bean user and the property schedule.
 Why then did it not find jobRequest? And why was Struts looking in scope
 null?
 Shouldn't the bean jobRequest be in the same scope as user?

 Appreciate any help.


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



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



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




Re: Need help with logic:iterate :)

2001-04-19 Thread Dan Miser

You're closing your first element, so the iterate never gets to the 
bean:write until after the loop is finished.

You have:
logic:iterate id="storerooms" name="storeroomList" scope="application"
property="storeroomList"/

It should be (note the lack of the trailing slash):
logic:iterate id="storerooms" name="storeroomList" scope="application"
property="storeroomList"

If you only want to do something for one specific bean, then use logic:equal 
inside the iterate tag.
--
Dan Miser
http://www.distribucon.com

From: "Alex Colic" [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: "Struts" [EMAIL PROTECTED]
Subject: Need help with logic:iterate :)
Date: Thu, 19 Apr 2001 15:50:44 -0400

I
have attempted the below but the only storeroom name to be printed out to
the screen is the last storeroom. I traced the execution of the iterate
class and it looks to be getting the correct data, going through each
element of the vector and pulling out the name property and then looping
through all the elements without printing them to the screen and then the
bean:write is called.

Oh, bonus question.. Lets say I only wanted to print out a particular
storeroom. Iterate through the vector but only print the storeroom that had
the name "main."


logic:iterate id="storerooms" name="storeroomList" scope="application"
property="storeroomList"/
   bean:write name="storerooms" property="name" /BR
/logic:iterate

_
Get your FREE download of MSN Explorer at http://explorer.msn.com




RE: Need help with logic:iterate :)

2001-04-19 Thread Roman Fail

Your logic:iterate tag closes itself before it gets to the tag body.
i.e. logic:iterate/
I made this mistake a couple times too so don't feel bad!
 
On your bonus question, your JSP shouldn't be performing business logic,
the bean should be.  Create another getter on your bean for the specific
thing you want to display.  Alternatively, inside your logic:iterate
you could wrap a logic:equal tag around your bean:write and
conditionally display a particular value within the iteration.
 
Roman

 
-Original Message- 
From: Alex Colic 
Sent: Thu 4/19/2001 12:50 PM 
To: Struts 
Cc: 
Subject: Need help with logic:iterate :)



Hi,

I am trying to get a handle on the logic:iterate tag.

I have an object in application scope under the key
'storeroomList.'
There is a vector of objects under the property 'storeroomList'.
Each one of
the objects in this vector has a property 'name.'

What I am trying to do is go through the vector and print out
the names. I
have attempted the below but the only storeroom name to be
printed out to
the screen is the last storeroom. I traced the execution of the
iterate
class and it looks to be getting the correct data, going through
each
element of the vector and pulling out the name property and then
looping
through all the elements without printing them to the screen and
then the
bean:write is called.

Any help is as usual greatly appreciated.


Oh, bonus question.. Lets say I only wanted to print out a
particular
storeroom. Iterate through the vector but only print the
storeroom that had
the name "main."


logic:iterate id="storerooms" name="storeroomList"
scope="application"
property="storeroomList"/
bean:write name="storerooms" property="name" /BR
/logic:iterate


Regards

Alex




 winmail.dat


Re: Need help with logic:iterate :)

2001-04-19 Thread Oldeboershuis, Simon

Hi Alex,

see below
Alex Colic schrieb:
 
 Hi,
 
 I am trying to get a handle on the logic:iterate tag.
 
 I have an object in application scope under the key 'storeroomList.'
 There is a vector of objects under the property 'storeroomList'. Each one of
 the objects in this vector has a property 'name.'
 
 What I am trying to do is go through the vector and print out the names. I
 have attempted the below but the only storeroom name to be printed out to
 the screen is the last storeroom. I traced the execution of the iterate
 class and it looks to be getting the correct data, going through each
 element of the vector and pulling out the name property and then looping
 through all the elements without printing them to the screen and then the
 bean:write is called.
 
 Any help is as usual greatly appreciated.
 
 Oh, bonus question.. Lets say I only wanted to print out a particular
 storeroom. Iterate through the vector but only print the storeroom that had
 the name "main."
 
 logic:iterate id="storerooms" name="storeroomList" scope="application"
 property="storeroomList"/
  ^
You close the iterate tag by putting the ending "/" right in the start
tag. 
I had this problem several times. It is a pity that there is NO ERROR
message is generated
 bean:write name="storerooms" property="name" /BR
 /logic:iterate
 
 Regards
 
 Alex