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

Tag question  RSS feed

 
Jayashree Mohan
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the tld file,

<tag>
<name>ForwardTag</name>
<tag-class>com.baboon.action.ForwardTag</tag-class>
<body-content>empty</body-content>
</tag>

JSP page:
<myTagLib:ForwardTag><% String s = "Forwarding"; %></myTagLibForwardTag>

Now, will this give a compiler error or runtime exception???
 
Charles Lyons
Author
Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should be a translation error - during translation, the container does a validation of the document, all URIs and tag library references it contains, and verifies that all tags have the correct body content, attributes, types of attribute values etc. as declared in the TLD. If anything is wrong, you'll get an error at that point - the page isn't even translated into servlet source code, let alone compiled; so compilation and runtime errors are impossible!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!