Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Enthuware Question Query

 
Aditi Kamra
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I came across this question in one of the enthuware mock exams

Assuming that a taglib directive of <%@ taglib prefix='abc' uri='http://abc.com/taglibX'> exists, what will be the output of the following code?
Given the body content is defined as tagdependent in the tld.

<abc:print>
<%= 3*4 %>
</abc:print>
(Assume that this tag just prints its body to the output.)

The answer given is <%= 3*4 %> with an explanation Since the body content of the tag is tagdependent, the body of the tag will not be processed by the JSP engine. It must be processed by the tag itself. In this case, it will get <%= 3*4%> as its body. So this is what it will output in the result.
My queries are :
(1) If we have an EL instead in the body say ${beanName.property} then will it be also printed as it is without evaluation ???
(2) My second query is how is the assumption mentioned relevant to the question (Assume that this tag just prints its body to the output.)

Can somebody help me over this ...
Thanks in advance.
 
Devaka Cooray
Marshal
Pie
Posts: 4897
409
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My second query is how is the assumption mentioned relevant to the question (Assume that this tag just prints its body to the output.)
It says that the tag does nothing other than simply printing its body content.

If we have an EL instead in the body say ${beanName.property} then will it be also printed as it is without evaluation ???
Duhh! It's your turn. You *must* write your own program to test that yourself.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic