You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Eran Kalmanson <er...@sundaysky.com> on 2007/07/12 14:36:31 UTC

Random tag library - dynamic range

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

 

 


RE: Random tag library - dynamic range

Posted by Eran Kalmanson <er...@sundaysky.com>.
First of all, thanks Kris.

Sadly though, it didn't work. 

I keep getting the same error, even though I changed the TLD:
/WEB-INF/tags/scene4.tag(124,2) According to TLD or attribute directive in
tag file, attribute range does not accept any expressions


Eran

-----Original Message-----
From: Kris Schneider [mailto:kris@dotech.com] 
Sent: Thursday, July 12, 2007 5:41 PM
To: Tag Libraries Users List
Subject: Re: Random tag library - dynamic range

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 <er...@sundaysky.com>:

> 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 <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

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





-- 
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 7/11/2007
9:57 PM



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


Re: Random tag library - dynamic range

Posted by Kris Schneider <kr...@dotech.com>.
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 <er...@sundaysky.com>:

> 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 <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

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