hello,
i have a question about the logic:iterate tag. My tag iterates over an ArrayList
which contains an amount of beans. However, in the last iteration i want to perform
some special action. My current code looks something like this:
logic:iterate id=foo name=bar scope=session indexId=index
PROTECTED]
Gesendet: Freitag, 6. Februar 2004 09:08
An: [EMAIL PROTECTED]
Betreff: logic:iterate question
hello,
i have a question about the logic:iterate tag. My tag iterates over an ArrayList
which contains an amount of beans. However, in the last iteration i want to perform
some special action
Sorry, I mean:
foo.length-1 instead bar.length-1
-Ursprüngliche Nachricht-
Von: Otto, Frank [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 6. Februar 2004 10:41
An: 'Struts Users Mailing List'
Betreff: AW: logic:iterate question
Hello Ben,
you can do this in this way:
logic:iterate id
, februari 06, 2004 10:46
To: 'Struts Users Mailing List'
Subject: AW: logic:iterate question
Sorry, I mean:
foo.length-1 instead bar.length-1
-Ursprüngliche Nachricht-
Von: Otto, Frank [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 6. Februar 2004 10:41
An: 'Struts Users Mailing List
i have a question about the logic:iterate tag. My tag
iterates over an ArrayList which contains an amount of beans.
However, in the last iteration i want to perform some special
action. My current code looks something like this:
logic:iterate id=foo name=bar scope=session indexId=index
: logic:iterate question
i have a question about the logic:iterate tag. My tag
iterates over an ArrayList which contains an amount of beans.
However, in the last iteration i want to perform some special
action. My current code looks something like this:
logic:iterate id=foo name=bar scope
shouldn't that be?
c:if test=${stat.last}
Yes, it sure should. And the first line should be:
c:forEach items=${foo.bar} var=bar varStat=stat
So the whole thing should look like this:
c:forEach items=${foo.bar} var=bar varStat=stat
c:if test=${stat.last}
do what needs to be
Hi,
How can I iterate over a collection which depends of a request
parameter?
Thank You a lot,
Dragos
From: Dragos Madalin Popa [mailto:[EMAIL PROTECTED]
How can I iterate over a collection which depends of a request
parameter?
JSTL and/or Struts-EL can probably help, but I'm not quite sure what
your question is. Can you give an example?
--
Wendy Smoak
Application Systems Analyst, Sr.
ASU
Hi,
Thank you for your answer.I would like to change the code shown below,
to pass a request parameter to the modelList function;something like
this:
public Collection getModelList(String requestString){}, where
requestString is a parameter of the http request..
Warmest Regards,
Dragos
From: Dragos Madalin Popa [mailto:[EMAIL PROTECTED]
Thank you for your answer.I would like to change the code shown below,
to pass a request parameter to the modelList function;something like
this:
public Collection getModelList(String requestString){}, where
requestString is a parameter of
You should be able to use BeanUtils' mapped property access for this, right?
c:set var=modelListProp value=modelList(${param.paramName})/
jsp:useBean id=modelListProp type=java.lang.String/
bean:define id=modelList name=bean property=%= modelListProp %/
Which should give you a bean called
Forgot the obligatory, but you should really do this in an action. There's no
reason to clog your JSP with this kind of stuff. Grab the collection in an
action, set it as a request attribute, forward to the JSP, and...
Quoting Kris Schneider [EMAIL PROTECTED]:
You should be able to use
I don't think you can pass parameters in JSTL, at least not yet. But
you could, in your action, call getModelList passing the String you got
from the request, and then when you forward to the JSP, iterate over
that Collection.
I am not sure what you meant, Wendy, but, in case you meant that you
I have
logic:iterate id=testers name=testerInfo
.
/logic:iterate
I only have one item in the testerInfo collection.
Why can't i do
bean:define id=testers name=testerInfo/
Or how can i put it to the first item?
Thanks !
, December 19, 2003 6:51 AM
Subject: logic:iterate question
I have
logic:iterate id=testers name=testerInfo
.
/logic:iterate
I only have one item in the testerInfo collection.
Why can't i do
bean:define id=testers name=testerInfo/
Or how can i put it to the first item?
Thanks
The following link should help:
http://www.mail-archive.com/[EMAIL PROTECTED]/msg71256.html
however it talks about using el, but this is not
necessary.
I have got the nested tags to work properly. The
logic tag should work, but I think I was doing
something slightly wrong when I tried.
hi all,
i have a Map-backed action Form which contains an HashMap
the ActionForm is as follows
public MapActionForm extends ActionForm {
HashMap table = new HashMap();
public void setValue(String key, String value) {
...
}
public Object
]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: logic:iterate question
Date: Sat, 25 Jan 2003 05:59:56 +
i have a HashMap stored in the session (as 'events') i'm trying to use the
logic:iterate tag to iterate through it in my jsp in a nested fashion
i have a HashMap stored in the session (as 'events') i'm trying to use the
logic:iterate tag to iterate through it in my jsp in a nested fashion. the
HashMap has a bean as the key and a collection of beans as its value. when i
try to run the page, i get an error: Cannot create iterator for this
I have a JSP. I have some scriplet code that defines an object and then I
want to iterate over that object, but I keep getting an error that the
object is not defined in the page scope. Looking at the docs I don't
understand what I'm doing wrong.
---
%
pageContext.setAttribute(myObj, myObj,
.
Sri
-Original Message-
From: Andy Kriger [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 3:24 PM
To: Struts Users Mailing List
Subject: logic:iterate question
I have a JSP. I have some scriplet code that defines an
object and then I want to iterate over
Yes - I store some data in it and then want to use that data later in the
page.
-Original Message-
From: Sri Sankaran [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 15:32
To: Struts Users Mailing List
Subject: RE: logic:iterate question
Dumb question: Is the object
in
the
page.
-Original Message-
From: Sri Sankaran [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 15:32
To: Struts Users Mailing List
Subject: RE: logic:iterate question
Dumb question: Is the object reference 'myObj' pointing at anything
before
set it to the name 'myObj
I have two vectors of the same length. I can iterate over one and retrieve
values. How can I use the index of that iteration to reference the other
vector?
For example
vOne = { 1,2,3,4 }
vTwo = { a,b,c,d }
I iterate over vOne producing 1,2,3,4,
logic:iterate id='item' name='vOne' indexId='idx'
Users Mailing List
Subject: logic:iterate question
I have two vectors of the same length. I can iterate over one
and retrieve
values. How can I use the index of that iteration to
reference the other
vector?
For example
vOne = { 1,2,3,4 }
vTwo = { a,b,c,d }
I iterate over vOne
Since you can access specific item in a list through something like
this:
bean:write property=vTwo[0]/
You should be able to do what you want through a scriptlet:
ie
bean:write property='%=vTwo[+idx+]%'/
We use this trick all the time ( and I gleaned it from this fabulous
list in the first
hello all,
is there any way to get the current loop number (or index) of a an iterate tag?
i have the following code:
logic:iterate id=fields name=report property=fields
a href=sort.do?sortIndex=I.Want.The.Current.Index.Of.Iteration.Herebean:write
name=fields//a
/logic:iterate
do i need to
-Original Message-
From: Mark Silva [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 29, 2002 2:46 PM
To: [EMAIL PROTECTED]
Subject: logic:iterate question (index available?)
hello all,
is there any way to get the current loop number (or index) of
a an iterate tag?
i have
I figured out my problem...I had a small logic error elsewhere in my code,
so
the form was returning a null for the String array. Struts does NOT like
null
arrays, and it was apparently going into the ozone. It would be nice if
Struts
detected nulls and threw some sort of an error.
Bryan
Consider the following scenario:
My Action class adds a Facility object to the request and forwards to a
JSP for presentation. The Facility object contains an array of
PhoneNumber objects.
My question is: Using struts tags, is it possible to pull the
PhoneNumber[] array out of the Facility
PROTECTED]]
Sent: Friday, August 09, 2002 11:40 AM
To: [EMAIL PROTECTED]
Subject: logic:iterate question
Consider the following scenario:
My Action class adds a Facility object to the request and forwards to a
JSP for presentation. The Facility object contains an array of
PhoneNumber objects.
My
methods.
The beauty of this is that you can go any number of levels deep.
Sri
-Original Message-
From: Aiken, Weston - Raleigh, NC [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 09, 2002 11:40 AM
To: [EMAIL PROTECTED]
Subject: logic:iterate question
Consider the following scenario:
My
Keith
Perfect, thanks a bunch.
Weston
-Original Message-
From: [EMAIL PROTECTED]
at INTERNET
Sent: Friday, August 09, 2002 12:08 PM
To: Aiken, Weston - Raleigh, NC; [EMAIL PROTECTED] at
INTERNET
Subject: RE: logic:iterate question
Hey,
It's not a problem to pull a list out
logic:iterate id='element'
name='attribute'
scope='page' type='java.lang.String' indexId='index'
bean:write name='MAP_STATE_KEY'
property='mapController.dataConnection.attributeNames[%= index %]'
scope='session'/
Correct your bean:write tag
[mailto:[EMAIL PROTECTED]]
Sent: 25. april 2002 14:36
To: [EMAIL PROTECTED]
Subject: logic:iterate question
Hello all,
I've got a question about the logic:iterate tag. I'm trying to
reference a bean which returns a String[] but I only want one of the
values in the array. The indexID is working
hello,
i have a problem on one of my views with a logic:iterate tag. i have
an action that fetches news headlines from a database
(headline,headlineID) and stores them in a bean
(headlines-Arraylist,headlinedID-Vector) which is appended to
request/session. On the view i want to iterate through
, 2002 12:58 PM
Subject: logic:iterate question
hello,
i have a problem on one of my views with a logic:iterate tag. i have
an action that fetches news headlines from a database
(headline,headlineID) and stores them in a bean
(headlines-Arraylist,headlinedID-Vector) which is appended to
request
links like this: a href=ViewHeadlineAction.do?headlineID=XXYZ/a
supposing the logic:iterate id paramenter is set to element
It should be something like this
html:link page=ViewHeadlineAction.do paramName=element
paramId=headlineID paramPropery=getterMethodWhoReturnsX
instead of the static a/a
This should work ... ( use bean:write to set the value of the parameter ... )
logic:iterate id=headline name=headlines scope=session
a href=ViewHeadLineAction.do?headLineId=bean:write name=headline
property=headlineID/
View Headline
/a
/logic:iterate
On 14 Feb 2002 11:58:39 +0100
thanks! thats it. now it works... ;)
oli
Am Don, 2002-02-14 um 12.13 schrieb Ivan Siviero:
links like this: a href=ViewHeadlineAction.do?headlineID=XXYZ/a
supposing the logic:iterate id paramenter is set to element
It should be something like this
html:link page=ViewHeadlineAction.do
=loop
value=id/)/
this should become input type=button onclick=go(show,1)
Gr
Ronald
-Original Message-
From: Oliver Kiessler [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 14, 2002 12:21 PM
To: Struts Users Mailing List
Subject: Re: logic:iterate question
thanks! thats
PROTECTED]]
Sent: Thursday, February 14, 2002 12:21 PM
To: Struts Users Mailing List
Subject: Re: logic:iterate question
thanks! thats it. now it works... ;)
oli
Am Don, 2002-02-14 um 12.13 schrieb Ivan Siviero:
links like this: a
href=ViewHeadlineAction.do?headlineID=XXYZ
can't you create a form around each button ??
I can do that I suppose, but not sure whether old netscape users like
multiple forms.
Other problem is that if you define forms within a table the table row will
become larger, but thx for that solution
Gr
Ronald
Furore B.V.
Rijswijkstraat 175-8
PROTECTED]
Subject: logic:Iterate question
Hi all,
I am using the iterate tag to iterate over a collection of items stored in the
FormBean. And all work fine (so far :) ). My question is: A I have a large number of
items in the collection is it possible arrange them in columns?? Here is a code
7:01 PM
Subject: logic:Iterate question
Hi all,
I am using the iterate tag to iterate over a collection of items stored in
the FormBean. And all work fine (so far :) ). My question is: A I have a
large number of items in the collection is it possible arrange them in
columns?? Here is a code
Hi
all,
I am using
the iterate tag to iterate over a collection of items stored in the FormBean.
And all work fine (so far :) ). My question is: AI have a large number of
items in the collection is it possible arrange them in columns?? Here is a code
snippet:
logic:iterate id="facility"
47 matches
Mail list logo