Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

regarding c:if

 
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I came acrross follwoing problem in getting correct result for values >=100

here it goes the following if statement gives me true


o/p
99 19 true
where as following gives me false


O/P
100 19 false

kindly let me know the solution,if I need to use integer types,then HOW TO ?

Cheers
-Praful
 
Praful Thakare
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Am I the only one on this earth to face this problem ??

JSTL Gurus kindly help out ....

-P
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its really wiered.
Have you tried the same code with some other machine?
Let me try and get back to you. What else I can say.
 
Praful Thakare
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its really wiered.

I know it is, and the solution is more wiered...

I did following for defining maxRecord
<c:set var="maxRecord" value="${100+0}"/>

Well now my problem is solved,but itz kind of untidey way to do it...
still waiting for some to show me correct way ...

Cheers
-Praful
[ March 09, 2005: Message edited by: Praful Thakare ]
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Praful Thakare:
<c:set var="maxRecord" value="${100+0}"/>



Hey whats that. It means 99+1 would also work.
 
Praful Thakare
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My code was as follows

<c:set var="maxRecord" value="${MaximumRecord}"/>

where MaximumRecord is session variable,so I thought

JSTL might consider it as

String maxRecord=(String) session.getAttribute("MaximumRecord");

hence by adding +0 I tried telling JSTL that MaximumRecord is of Numeric Type and it actully worked !!! Lucky me

N ya 99+1 should work as well....not sure thou.

-Praful
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Praful Thakare:
My code was as follows

<c:set var="maxRecord" value="${MaximumRecord}"/>

where MaximumRecord is session variable,so I thought

JSTL might consider it as

String maxRecord=(String) session.getAttribute("MaximumRecord");



Why you didn't post the actual code?

Anyways, please try to <c ut> MaximumRecord, then we will know for sure what was happening actually. Whether, MaximumRecord is considered as String or Object or something else.
[ March 10, 2005: Message edited by: Adeel Ansari ]
 
I’m tired of walking, and will rest for a minute and grow some wheels. This is the promise of this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic