• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

True Statement about Tag

 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following is an entry in JSTL's Core tags descriptor.
Select the true statements about this tag.

<tag>
<description>
Catches any Throwable that occurs in its body and optionally
exposes it.
</description>
<name>catch</name>
<tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>






Answers
1) This is an example of an empty tag.


2) The attribute "var" cannot use a JSP runtime expression.


3) The tag may have the attribute "var" supplied.



The correct answers are 2) and 3).

I didnt got it how the answer 3) is correct?
 
Sandeep Bhandari
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<rtexprvalue>false</rtexprvalue>

means that the tag can't take JSP runtime expression as its value which means that values which are present at runtime can't be used.
 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for replying.
How abt answer 3?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
3) There's an tag attriubte called "var" which is not required. So The tag may have the attribute "var" supplied.
 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Verre Super Bar Tender for reply. But you can see in JSTL core descriptor, the tag attribute 'var' is already there present. SO how it can be supplied?. The thing which is already present how can again be supplied. There can be one reason for that the element <required> is false. That's why it says to be required but it doesnt makes much sense. what you think?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It means that when you use this tag you can either use (supply) the var attribute :
<c:catch var="bob"> ....
or not
<c:catch> ....
 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i got it, its pretty confusing,,, to understand to depth but thanks very much...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic