Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL not operator question  RSS feed

 
Tim Manchester
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy,

I'm looking at a jsp that isn't working as I thought it should and I see several cases where a comparison is done that the '!' operator is used as opposed to 'not'. I haven't read that you can use '!' alone so I was wondering if that was a problem with the following lines...


I do know you can use '!=' which I imagine could lead to the confusion with '!'. Am I correct about this?

Regards,

Tim
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
! as a unary operator and the not keyword are synonymous.
 
Tim Manchester
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, thanks!

Regards,

Tim
 
Tim Manchester
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Follow up question:

Is it a bug to say


should you say


?

Regards,

Tim
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The whitespace is moot. Are you seeing a concrete problem?
 
Tim Manchester
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes but it's difficult to get the data so I was hoping it would be a jsp issue. It looks more like a data issue now. Thanks.

Regards,

Tim
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It usually is. Some perverse law says that the problem will always be in the area hardest to debug!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!