• Post Reply Bookmark Topic Watch Topic
  • New Topic

a question about c:if

 
Henry Zheng
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is mentioned in the jstl 1.1 specification that <c:if> can be an empty tag that carries no body content.
But I wonder why do we need an empty <c:if>? Just in order to store a boolean result in a scoped variable?

thanks
 
Vijay S. Rathore
Ranch Hand
Posts: 449
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's the place where scope comes into picture. If your declare an c:if without a body you have to give at least 'var' and 'scope. And then you can use this 'var' anywhere in the defined scope.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!