Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP.2.3.4 Empty Elements - JSP Specs ?

 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

While the following are all non-empty tags:
<foo> </foo>
<foo><%= expression %></foo>
<foo><% scriptlet %></foo>
<foo><bar/></foo>
<foo><!-- a comment --></foo>

While I am (not sure but) comfortable to assume that the last line in NOT empty because it contains a HTML comment which will be transmitted to the client. However, I can't understand why the first line in non-empty?
Am I missing something in the first line?
There seems to be a space, but does that make it non-empty?
Thanks for your help.
- satya
 
Ram Dhan Yadav K
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Madhav,
During translation time of JSP, white space is preserved. So white space means non-empty.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic