You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Balakrishnan, Vijay" <VB...@newedgenetworks.com> on 2003/10/25 03:00:05 UTC

jstl query

Hi,

How do i do the following portName.length() inside test :
<c:set var="portName" value="TEST" />
<c:if test="${ portName.length() > 15}">  <================
				
</c:if>

Thanks in advance,
Vijay

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


Re: jstl query

Posted by "Craig R. McClanahan" <cr...@apache.org>.
Yann Cébron wrote:

>>>>How do i do the following portName.length() inside test :
>>>><c:set var="portName" value="TEST" />
>>>><c:if test="${ portName.length() > 15}">  <================
>>>>
>>>></c:if>
>>>>        
>>>>
>>>If you can use JSTL1.1, you can use the fn: Function-Library
>>>to query the length of properties
>>>
>>>http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html
>>>      
>>>
>>Hi Yann,
>>can you give a quick example of the use of this function library, and
>>perhaps the taglib declaration.
>>
>>I couldn't find anything in the spec.
>>    
>>
>
>Here's a good summary of the fn: library including an example using
>fn:length:
>
>http://java.sun.com/webservices/docs/1.3/tutorial/doc/JSTL8.html#wp84680
>
>  
>
To avoid confusion, it is worth nothing that these functions are part of 
the expression language in JSP 2.0 and JSTL 1.1 (both included in JWSDP 
1.3), but not JSTL 1.0.

>HTH,
>    Yann
>
>  
>

Craig



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


Re: jstl query

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
On 10/25/2003 01:45 PM "Yann C�������������������������" wrote:
> 
> 
> Here's a good summary of the fn: library including an example using
> fn:length:
> 
> http://java.sun.com/webservices/docs/1.3/tutorial/doc/JSTL8.html#wp84680

Yann, thanks. That functionality is excellent. This is I guess exactly 
what the original poster was asking for.

Adam
-- 
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9

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


Re: jstl query

Posted by Yann C�bron <ya...@yahoo.de>.
> >>How do i do the following portName.length() inside test :
> >><c:set var="portName" value="TEST" />
> >><c:if test="${ portName.length() > 15}">  <================
> >>
> >></c:if>
> >
> >
> > If you can use JSTL1.1, you can use the fn: Function-Library
> > to query the length of properties
> >
> > http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html
>
> Hi Yann,
> can you give a quick example of the use of this function library, and
> perhaps the taglib declaration.
>
> I couldn't find anything in the spec.

Here's a good summary of the fn: library including an example using
fn:length:

http://java.sun.com/webservices/docs/1.3/tutorial/doc/JSTL8.html#wp84680

HTH,
    Yann




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


Re: jstl query

Posted by Adam Hardy <ah...@cyberspaceroad.com>.

On 10/25/2003 12:13 PM "Yann C�������������������������" wrote:
>>How do i do the following portName.length() inside test :
>><c:set var="portName" value="TEST" />
>><c:if test="${ portName.length() > 15}">  <================
>>
>></c:if>
> 
> 
> If you can use JSTL1.1, you can use the fn: Function-Library
> to query the length of properties
> 
> http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html

Hi Yann,
can you give a quick example of the use of this function library, and 
perhaps the taglib declaration.

I couldn't find anything in the spec.

Adam
-- 
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9


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


Re: jstl query

Posted by Yann C�bron <ya...@yahoo.de>.
>
> How do i do the following portName.length() inside test :
> <c:set var="portName" value="TEST" />
> <c:if test="${ portName.length() > 15}">  <================
>
> </c:if>

If you can use JSTL1.1, you can use the fn: Function-Library
to query the length of properties

http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html


HTH,
    Yann




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


Re: jstl query

Posted by Adam Hardy <ah...@cyberspaceroad.com>.

On 10/25/2003 03:00 AM Balakrishnan, Vijay wrote:
> Hi,
> 
> How do i do the following portName.length() inside test :
> <c:set var="portName" value="TEST" />
> <c:if test="${ portName.length() > 15}">  <================
> 				
> </c:if>
> 

Hi Vijay,
you can't use portName.length() because length() is not one of the 
javabean specification-compliant methods of String. In fact, I don't 
think String has any.

What you can try and this is without testing, is:

<c:set var="portNameLen"><%="TEST".length() %></c:set>
<c:if test="${portNameLen > 15}">
....
</c:if>

Adam

-- 
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9


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