• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL - gt/le not working with variables

 
koushik Rock
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a block of code like this -->

now, the code flow should reach block 1, but it is interpreting remainderQty as string and failing the comparison and end up reaching block 2.
Can anyone experienced the same? What is the alternative/fix available for the same?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18282
56
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are several problems here.

First of all, "Code should not flow" in your View Definition. The View Definition is not the place to put logic. It pollutes the Model/View/Controller Separation of Concerns contract. Logic should be in backing beans. The View should only contain graphic templates.

Secondly, JSTL is not recommended with JSF. JSTL assumes a servet/JSP architecture and JSF works on completely different principles, so JSTL frequently malfunctions. For any View-related conditions that you need to specify, JSF has native constructs that work much better than JSTL.

Finally, the View Template Language (also known as View Definition Language or ".xhtml") is an XML format document and therefore must adhere to the XML syntax rules. Because the less-than, greater-than, quote, apostrohe and ampersand characters all have specific meanings in XML, any attempt to insert them into text values can result in ambiguous syntax which must be resolved by using CDATA or entity escapes.
 
koushik Rock
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Tim for the reply.
I have used the following facelet and resolved the issue.

where ui is "xmlns:ui="http://java.sun.com/jsf/facelets".
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18282
56
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Much more tidy, no?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic