Re: Random tag library - dynamic range

Kris Schneider <[email protected]>
Newsgroups gmane.comp.jakarta.taglibs.user
Message-ID <[email protected]>
Looking at the docs
(http://jakarta.apache.org/taglibs/doc/random-doc/index.html), it doesn't
appear that the taglib really supports request-time attr values. Strange.
Personally, I'd grab the TLD and change this:

<tag>
    <name>number</name>
    ...
    <attribute>
      <name>range</name>
      <required>no</required>
      <rtexprvalue>no</rtexprvalue>
    </attribute>
    ...

to this:

<tag>
    <name>number</name>
    ...
    <attribute>
      <name>range</name>
      <required>no</required>
      <rtexprvalue>yes</rtexprvalue>
    </attribute>
    ...

and see what happens...

Quoting Eran Kalmanson <[email protected]>:

> Howdy,
> 
>  
> 
> I've been having difficulties with the random taglib. I'm interested in
> getting a random number using a dynamic range. However I can't find a way to
> do that.
> 
>  
> 
> I've tried
> 
>  
> 
> <c:set var="top" value="43" />
> 
>  
> 
> <rand:number id="randNumber" range="1-${top}" />
> 
>  
> 
> Didn't work. Syntax error.
> 
>  
> 
> I've also tried
> 
>  
> 
> <c:set var="range" value="1-43" />
> 
>  
> 
> <rand:number id="randNumber" range="${range}" />
> 
>  
> 
> Didn't work either. Couldn't find anything relevant on the web. Would love
> some help with that.
> 
>  
> 
> Thanks,
> 
> Eran Kalmanson

-- 
Kris Schneider <mailto:[email protected]>
D.O.Tech       <http://www.dotech.com/>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.