File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Which options correctly pass two attributes to a custom tag ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Which options correctly pass two attributes to a custom tag ?" Watch "Which options correctly pass two attributes to a custom tag ?" New topic
Author

Which options correctly pass two attributes to a custom tag ?

Kosala W.Abayagunawardene
Ranch Hand

Joined: Dec 15, 2007
Posts: 47

I found this question on enthuware Question ID: 1077656812758
Which of the following options correctly pass two attributes to a custom tag?

Select 3 correct options
a <prefix:sometag 'val1' 'val2' />


b <prefix:sometag ${'val1'} ${'val2'} />


c <prefix:sometag attrA='val1' attrB='val2' />


d <prefix:sometag attrA=${"val1"} attrB=${"val2"} />


e <prefix:sometag>
<jsp:attribute name='attrA' value='val1' />
<jsp:attribute name='attrB' value='val2' />
</prefix:sometag>


f <prefix:sometag>
<jsp:attribute name='attrA'>val1</jsp:attribute>
<jsp:attribute name='attrB'>val2</jsp:attribute>
</prefix:sometag>

Answers are given as c,d,and f.

could someone please explain each answer in detail as it is bit confusing to me.(ASAP)Thanks


[SCJP] ::[SCWCD]::[BCS::BIT::SCBCD] - Studying[My Blog]
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3775

You can pass data to the tag handler in the form of attributes which are processed by the tag handler and do whatever it wants. Ther's only a syntax difference between them. <jsp:attribute> It's just another way of setting attributes in a tag instead of directly putting them inside the tag (as with c & d options). Also <jsp:attribute> has the advantage of place itself in the body even the body content for that tag is declared to be empty.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Kosala W.Abayagunawardene
Ranch Hand

Joined: Dec 15, 2007
Posts: 47

Vijitha Kumara wrote:You can pass data to the tag handler in the form of attributes which are processed by the tag handler and do whatever it wants. Ther's only a syntax difference between them. <jsp:attribute> It's just another way of setting attributes in a tag instead of directly putting them inside the tag (as with c & d options). Also <jsp:attribute> has the advantage of place itself in the body even the body content for that tag is declared to be empty.



thanks for that
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Which options correctly pass two attributes to a custom tag ?
 
Similar Threads
JSPFragment
attributes to custom tags
some important mock exam experiences !!!
jsp:attribute - HFJ 472
pass two attributes to a custom tag