Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

comparing string to int in JSTL

 
mark hunt
Greenhorn
Posts: 8
  • 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: 65118
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear. Problem solved.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic