Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

comparing Integer values in JSP

 
bryan nelson
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This should probably be a simple one for most of you, but apparently not for me.

I am trying to do this:

<c:if test="${NoticeBean.mostRecent} == 1">

where NoticeBean.mostRecent returns a 0 or 1 of type Integer (not int).

Any idears?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64855
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try:



the braces must enclose the entire EL expression.
 
bryan nelson
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh man.
is my face red.

Thanks!!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64855
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's a common error. Don't feel bad.

Recomendation: rename NoticeBean to noticeBean. Scoped variables should follow normal Java variable naming conventions.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic