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 Few Doubts in HFSJ book 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 "Few Doubts in HFSJ book" Watch "Few Doubts in HFSJ book" New topic
Author

Few Doubts in HFSJ book

georgy jacob
Ranch Hand

Joined: Nov 23, 2005
Posts: 53
Hi,

I am planning to take the exam on the 13 th of March. I have a few doubts.Could u please get them clarified ?

1) Its mentioned in HFSJ that EL handles null values gracefully and doesnt print null if a null value is passed.
But on pg :509

<mytags:simple>
message is ${message}
</mytags:simple>
its said that if${message occurs out of the scope of the tag null will be printed .
Isnt it supposed to not print anything rather than null


2) while we are implementing the tag handler class are we supposed to write a no arg constructor in the tag handler in case we have a constructor which takes in one argument
for ex :
class Test extends SimpleTag Support
{
Test(int a)
{ }
// attribute setters and getters defined here

}
Now will the above code compile if i dont write a no arg constructor ?


3) response.encodeRedirectURL()does redirecting to a URL inaddition to encoding the url . Am i right here ? But in the mock exam there is a qn which asks which of the following methods can redirect to a different URL (one option given is response.encoderedirectURL) but response.encodeRedirectURl is not given as a correct option there.Could u please clarify on this issue as wel

Thanking u in advance,
Georgy
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hi

1) Pl. specify the full description about this. The message is attribute or variable.



2) while we are implementing the tag handler class are we supposed to write a no arg constructor in the tag handler in case we have a constructor which takes in one argument
for ex :
class Test extends SimpleTag Support
{
Test(int a)
{ }
// attribute setters and getters defined here

}
Now will the above code compile if i dont write a no arg constructor ?



I think there is no compilation error the file will compile successfully. The compile-time error occurs when you use the Tag in the JSP file. Because at the time of compilation of JSP file the container validate all the tag libraries. The containe will not find the default construcutor for the tag handler and give compile time error.

Thanks




3) response.encodeRedirectURL()does redirecting to a URL inaddition to encoding the url . Am i right here ? But in the mock exam there is a qn which asks which of the following methods can redirect to a different URL (one option given is response.encoderedirectURL) but response.encodeRedirectURl is not given as a correct option there.Could u please clarify on this issue as wel


The response.encodeRedirectURL does not do the redirecting job. It only encode the URL. You still require to use the sendRedirect.


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
georgy jacob
Ranch Hand

Joined: Nov 23, 2005
Posts: 53
Thank you so much Narendra . My doubt has been cleared

For the first querry message is an attribute which is set in the tag handler
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hi,

Assuming that the "message" attribute is placed in page scope, this attribute is visible onlt in the tag. that in <prefix.tag> .... </prefix.tag> including body.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Few Doubts in HFSJ book