tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Townsend" <john.towns...@listenpoint.com>
Subject RE: xtags:ForEach question (involving parameters)
Date Fri, 13 Jul 2001 17:02:46 GMT
James.. thanks for the tip. As usual, I discovered my problem 15 minutes
after I posted to the list ;-) But, now I am trying something different
that doesn't seem to work. 

Here's the new select statement I am trying:

select = "//person[contains($field, $value)]"

Where field and value are parameters from the query string. $value seems
to work just fine, but the $field part doesn't. Does anyone have any
guidelines on what will and won't work when it comes to variable
substitution? The xtags documentation is alittle light in this area ;-)

Thanks,
John Townsend


-----Original Message-----
From: James Elson [mailto:James@citria.com] 
Sent: Friday, July 13, 2001 3:33 AM
To: taglibs-user@jakarta.apache.org; John Townsend
Subject: Re: xtags:ForEach question (involving parameters)

John Townsend wrote:

>         <xtags:forEach select = "//person[child::name[contains(text(),
> '$param')]]">
>
> [...]
>
>
>
> Select = "//person[child::name[contains(text(), 'John')]]"
>
> Then it works. But, I would like to pass in the 'John' parameter from
> the URL. The URL would look something like this:
>
> http://localhost:8080/myapp/mypage.jsp?param=John
>
> Can I do this? I thought if I put $param in my select statement it
would
> work, but it didn't seem to work.

I see you're putting the $param inside quotes. Try it without the string
delimiters:

<xtags:forEach select =
"//person[child::name[contains(text(),$param)]]">

  James

_________________________________________________________________

If you are not the addressee of this confidential e-mail and any 
attachments, please delete it and inform the sender; unauthorised 
redistribution or publication is prohibited. 
Views expressed are those of the author and do not necessarily 
represent those of Citria Limited.
_________________________________________________________________


Mime
View raw message