File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

comparing string to int in JSTL

 
mark hunt
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
mark hunt
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear. Problem solved.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic