Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Comparing an interger object and primitive

 
pavan babu
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I want to compare Integer object value to a primitive(int) in a jsp using EL how can i do it?

I'm struck as EL doesnot allow to call methods like nrwIntergerOBJ.intvalue()

BTW I'm using spring mvc with el.


Thanks
Pavan
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65542
110
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you tried and what isn't working?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65542
110
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hint: have you tried just comparing them?
 
pavan babu
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:What have you tried and what isn't working?


I tried to call intValue() method It was not working.

I got it woeked by introducing scriptlet and finding object in pageScope in the script.But I want to eliminate the scriptlet.I'm using spring with el.to get value i am using

<spring:bind> tag and inside it el statements.But I am not able to access the intValue() method of wrapper.
 
pavan babu
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes i tried
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65542
110
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try harder.

If o is an Integer instance with value 213, and i is an int with value of 213, then: will evaluate to true.
 
I have always wanted to have a neighbor just like you - Fred Rogers. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!