You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by S Schrem <ss...@yahoo.com> on 2003/11/14 17:21:14 UTC

[JELLY] Initializing a list

I'm trying to create a list within a jelly script to
be used by the tablemodel tag. The list needs to
contain several items. I've been using the 'uselist'
tag. I don't know how to put multiple strings via the
'items' attribute. I've also tried the following:
	<j:set var="item2" value="string2"/>
	<j:useList var="mylist">
		<j:expr value="string1"/>
		<j:expr value="${item2}"/>
	</j:useList>
Thanks,
Serge

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [JELLY] Initializing a list

Posted by S Schrem <ss...@yahoo.com>.
Paul, Thank you for your (quick) response, I had seen
a similar scheme described somewhere, however, I cant
(don't) want to make any assumptions about the format
of the data being placed in the list (e.g. number/type
of delimiter). The data I have is already discrete and
structured and may or may not be text data, it
wouldn't make sense to glom it together into a string
and then devise a scheme to break it up again.

The core "expr" tag does what I want (in terms of
expression evaluation) except that it places its
result in the xml output stream. The way I see it, the
"useList" tag's addItem method, by default, is only
invoked by BeanTag and its subclasses. This seems to
be way to far down the class hierarchy. I tried
inserting a "bean" tag that instantiates the
java.lang.String class inside the "uselist" tag, but
of course, String is not a bean (i.e. There is no
setter method for the text).

I know that if I wanted, I could create an "listItem"
tag which has a "value" attribute that can handle jexl
expressions and add them to the parent if it
implements the CollectionTag interface. I haven't done
this since I can't believe there isn't already a way
to do this in the existing Tag libraries.

Thanks,
Serge

--- Paul Libbrecht <pa...@activemath.org> wrote:
> How about
> 	<util:tokenize items="list">first second
> third</util:tokenize>
> 
> ??
> (note, syntax unchecked, please check taglibs)
> 
> Paul
> 
> S Schrem wrote:
> > I'm trying to create a list within a jelly script
> to
> > be used by the tablemodel tag. The list needs to
> > contain several items. I've been using the
> 'uselist'
> > tag. I don't know how to put multiple strings via
> the
> > 'items' attribute. I've also tried the following:
> > 	<j:set var="item2" value="string2"/>
> > 	<j:useList var="mylist">
> > 		<j:expr value="string1"/>
> > 		<j:expr value="${item2}"/>
> > 	</j:useList>
> > Thanks,
> > Serge
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [JELLY] Initializing a list

Posted by Paul Libbrecht <pa...@activemath.org>.
How about
	<util:tokenize items="list">first second third</util:tokenize>

??
(note, syntax unchecked, please check taglibs)

Paul

S Schrem wrote:
> I'm trying to create a list within a jelly script to
> be used by the tablemodel tag. The list needs to
> contain several items. I've been using the 'uselist'
> tag. I don't know how to put multiple strings via the
> 'items' attribute. I've also tried the following:
> 	<j:set var="item2" value="string2"/>
> 	<j:useList var="mylist">
> 		<j:expr value="string1"/>
> 		<j:expr value="${item2}"/>
> 	</j:useList>
> Thanks,
> Serge



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org