aspose file tools*
The moose likes JSP and the fly likes comparing string to int in JSTL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "comparing string to int in JSTL" Watch "comparing string to int in JSTL" New topic
Author

comparing string to int in JSTL

mark hunt
Greenhorn

Joined: May 02, 2007
Posts: 8
Hello,

I'm trying to compare two values with different type (String, int). Using scriplets, i would just covert one datatype to another and then compare them. How would i convert one to another in JSTL?. This is what i'm doing and it's not working (it never returns true):

divisionModel.divisionId is of type int. I tried using "==" operator as well but didn't work. Could someone please let me know what i'm doing wrong??. Thanks for your time and suggestion

Mark
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60997
    
  65

Technically you are not comparing in the JSTL but the EL.

Check the EL section of the JSP Spec to see what conversions occur during comparisons.
[ June 14, 2007: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
mark hunt
Greenhorn

Joined: May 02, 2007
Posts: 8
Thanks Bear. Problem solved.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: comparing string to int in JSTL