Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question regarding tagdependent  RSS feed

 
Marlo Magpantay
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

What would be the output if the body-content of the tld is tagdependent, then the body of the tag has expression?

<my:Classic name="Chris Marlo Magpantay">
<%=3*4%>
</my:Classic>

The correct answer in the enthuware mock exam is "<%=3*4%>". But when I tried it my sample app, it outputed nothing or blank. Can somebody please explain this? Thanks!
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the HTML source. You probably can't see it in the browser because it appears to be a tag.
 
Marlo Magpantay
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But in the exam, is the correct answer really "<%=3*4%>"?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marlo Magpantay wrote:But in the exam, is the correct answer really "<%=3*4%>"?

If there were such a question, I'd say yes.
 
Marlo Magpantay
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Christophe!
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Posts: 2920
205
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marlo ,

But in the exam, is the correct answer really "<%=3*4%>"?

It depends on the context of the question.

If the body-content of the tld is tagdependent the body <%=3*4%> is given to the tag handler code and it depends on that code if it outputs the body. If the tag handler code is not given in the question then the correct answer is that the body is not writen to the page. (by default it is not output)

Regards,
Frits
 
Marlo Magpantay
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Frits! I forgot to mention that the question said the tag handler code prints the body. So in that case, the correct answer is "<%=3*4%>".
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!