wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes some important mock exam experiences !!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "some important mock exam experiences !!!" Watch "some important mock exam experiences !!!" New topic
Author

some important mock exam experiences !!!

Niranjan Deshpande
Ranch Hand

Joined: Oct 16, 2005
Posts: 1277
1. when you use jsp:attribute to pass attributes to a custom tag whose body
is declared to be empty, note the
following usage -

<mine:customTag>
<jsp:attribute name="attrName">attrValue</jsp:attribute>
</mine:customTag>

or

<mine:customTag>
<jsp:attribute name="attrName">${someScopedVar}</jsp:attribute>
</mine:customTag>

or

<mine:customTag>
<jsp:attribute name="attrName">
<!-- some custom tag invocatin that retrns some value -->
</jsp:attribute>
</mine:customTag>

Note the the <jsp:attribut> does not have a attribute called "value", so
the following is invalid -

<mine:customTag>
<jsp:attribute name="attrName" value="attrValue></jsp:attribute>
</mine:customTag>

I choose this in the exam

2. Suppose my web app uses two listenrs, how do i configure it in D.D ?



OR as -



well.. the second option is correct ( please verif this guys ) as per the
exam engnie. HFSJ never tells about the DD syntax that should be used
to configure two listenrs.

3. this is the most amazing thing. all these arevalid sub elements for
the <tag> element in a TLD

<required>true</required> is same as
<required>yes</required>

<required>false</required> is same as
<required>no</required>

is it ? didnt check the specs

4.this is a relly good question on the <c out>

Assuming that the following line of code has already occured in a
scriptlet in a JSP page, which of the given JSTL code snippet will output
the right string in the resulting HTML so that the message in 'htmltext'
is displayed in HEAD1 style on the browser?

request.setAttribute("htmltext", "<h1>This is heading</h1>");

Select 2 correct options

a <c ut value="${htmltext}" escapeXml='true'/>
b <c ut value="${htmltext}" escapeXml='false' /> c <c ut value="${htmltext}" />
d <c ut value="${htmltext}" escape='true' />
e ${htmltext}
General Comments
A feature of the 'out' tag is that it performs XML character-entity
encoding for <, >, &, ", and ' automatically (by default). This means
that a < will be automatically encoded to < and a > will be encoded to
> and so on. In this case, however, we do not want this feature
because we want to write <h1> and </h1> in the output. Therefore, we need
to supress this feature by specifying escapeXml='false'. By default, ie.
if do not specify this attribute, it is assumed to be true that's why
option 3 will not work.
Option 5 will work because it writes to the output exactly whatever is
there the string.


to add to it...in short...if the escapeXML="true" then
the <h1>som message</h1> wll rendered as
<h1>some message< in the response
but we want it as
some message prined in HEAD1 style, so the response must be rendered as
<h1>som message</h1> for the browser to interpret as a Heading 1


5. no here comes the real thing -

i have this code in my JSP-



what code should i write in the tag handler so that it inrements a count
for each nesting level and shows the finlai result as 3.

case 1 - using classic tag handler

classic tag instances are reused by the container, so the tag handler
should / should not use a 'static' count variable..and increment
it and print in the doStartTag( ) method.

case 2 - using simple tag handler

simple tag intances are not reused by container. each time we use it
in the JSP, a new instance is created. in that case, the count variable
must be 'static' and and increment and print in the
doTag( ) method.

in either of the case, the count varible must not be 'local'

hope you guys get what i am saying. the concerned hfsj page is - 539.

expectig comments on my post

thanks


SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
Sayak Banerjee
Ranch Hand

Joined: Nov 28, 2006
Posts: 292
HFSJ never tells about the DD syntax that should be used
to configure two listenrs.

HFSJ uses an 80-20 approach....it's a book, not the spec. itself.....a mere inspection of the spec.s would clear all your doubts


Turn on, tune in, drop out.
Niranjan Deshpande
Ranch Hand

Joined: Oct 16, 2005
Posts: 1277
HFSJ uses an 80-20 approach....it's a book, not the spec. itself.....a mere inspection of the spec.s would clear all your doubts


yes...yes !
Sanjeev BhimaRao
Ranch Hand

Joined: Jul 17, 2006
Posts: 71
Thanks for sharing the experience Niranjan. Yes. Certain questions cannot be just answered by just reading HFSJ alone.
 
 
subject: some important mock exam experiences !!!