This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Custom Tag question  RSS feed

 
ani jadhao
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From one of mock question of java beat , I came across a custome tag ques .

....
<tag-class>com.print.PrintBodyTab</tag-class>
<body-content> tagdependent</body-content>
....

<ex:printbody><%=(3+2)%></ex:printbody>

Assuming all mapping in TLD is proper to run the tag . What will be the output of the above ?
options are
a.transalation error
b. runtime exceptin
c.response contains : "<%=(3+2)%>"
d. "5"

I guess , option c would be right fit over here as the body content is tagdependent here , so what ever would be in the body of tag , treated as plain text. :?: ?

Please correct me if am I wrong?
thanks
Ani

 
Shruthi Sam
Ranch Hand
Posts: 73
 
Harvinder Thakur
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes. tagdependent would imply treat the body as plain text. Hence any scripting or EL expressions would be ignored and output to the response as such
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!