• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFSJ Page#332

 
namita sasa
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand how the line#14 in question#11 in HFSJ is valid?
It says,
<% if (user.isValid()){%>You are valid!<%} %>

How this syntax is valid? Can somebody clarify?
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Namita. In <% if (user.isValid()){%>You are valid!<%} %>, there are two scriptlet parts, one is <% if(user.isValid()) { %> and <% } %>.
We know the code present in scriptlet will present as it is when the jsp compiler translates from .jsp to .java file. The code looks like this, in .java file. . If you see, the generated source files it will be clear. This is a valid example of scriptlet code.
 
namita sasa
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Chinmaya.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic