Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes JSF and the fly likes Reg:Facing problem with http://java.sun.com/jstl/core <choose > and <when > tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Reg:Facing problem with http://java.sun.com/jstl/core <choose > and <when > tags" Watch "Reg:Facing problem with http://java.sun.com/jstl/core <choose > and <when > tags" New topic
Author

Reg:Facing problem with http://java.sun.com/jstl/core <choose > and <when > tags

dhanaraja rajendran
Greenhorn

Joined: Nov 02, 2012
Posts: 3
Hi ,
i have declared the required tag libs like this on top of my xhtml page

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:e="http://ebreez.com/jsf"
xmlns:c="http://java.sun.com/jstl/core">

from my below code
<hutputText value="#{fn:length(my String)}"/> <========>>> is priting as 450 which correct
<hutputText value="#{fn:length(my String) > 350}"/> <========>>> is priting as "true" which is also perfect
<c:choose>
<c:when test="#{fn:length(myString) > 350}"> <=========>> but it is not going inside c:when ..instead of it is going to ctherwise
<hutputText value="#{fn:substring(my String, 0, 350)}..."/>
</c:when>
<ctherwise>
<hutputText value="#{my String}"/>
</c therwise>
</c:choose>

Note: 1.If I am manualy setting test="#{true}" or test="true" it is properly workng and going inside <c:when>
2. If iam using test="${true}" ie,instead of # symbol if i am using $ also same problem occurs for me..

can anybody please help me out from this problem
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16541
    
  25

Welcome to the JavaRanch, Dhanaraja!

We have a "Code" button that generates special tags in the message editor for wrapping sample code, XML, and other formatted text. It makes such things a lot easier to read. No smiley faces for one thing.

I do not recommend using JSTL with JSF. JSF has native equivalents that work much better.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
Have you tried LearnNowOnline? http://www.learnnowonline.com/
 
subject: Reg:Facing problem with http://java.sun.com/jstl/core <choose > and <when > tags