Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Mock Questions 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 "Mock Questions" Watch "Mock Questions" New topic
Author

Mock Questions

Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
1. Which of the following design patterns introduces an additional layer between client and server.(Select one choice.)

1. Intercepting filter
2. Front Controller
3. Service Locator
4. Business Delegate


2. Which of the following is true about security in web application? select one choice.(Select one choice.)

1. Declarative security is not applicable in the case of include and forward actions.
2. If no <http-method> element is present with in a <security-constraint> element, the constraint does not apply to any of the HTTP methods
3.The HTTP Digest mechanism requires a certificate from a certification authority.
4. Form-based authentication is more secure than the HTTP basic authentication.

3.The tag handler class of this tag extends from TagSupport. If EVAL_BODY_BUFFERED is returned from doStartTag(), what will be the result of accessing this jsp? (Select one choice.)

1. code does not compile
2. code causes an exception at runtime
3. body of the tag is not evaluated, so no output
4. prints "hello"
5. none of the above


My Answers

1. option 1
2. option 1
3. option 4

I am not sure with option 1 in second question. I appreciate if any one can confirm it.
[ February 08, 2006: Message edited by: Vishnu Prakash ]

Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Sunjeev Shetty
Ranch Hand

Joined: Aug 21, 2005
Posts: 48
Is EVAL_BODY_BUFFERED a valid return value for doStartTag for a class that extends TagSupport?
Ranjani Theyagarajan
Greenhorn

Joined: Feb 08, 2006
Posts: 19
Intercepting filter is the answer for the question 1.
Sunjeev Shetty
Ranch Hand

Joined: Aug 21, 2005
Posts: 48
Business Delegate is the answer for the first question.
satheesh krishnaswamy
Ranch Hand

Joined: Mar 17, 2004
Posts: 137
I too feel that Business Delegate is the answer for 1.

2. Which of the following is true about security in web application? select one choice.(Select one choice.)

1. Declarative security is not applicable in the case of include and forward actions.
2. If no <http-method> element is present with in a <security-constraint> element, the constraint does not apply to any of the HTTP methods
3.The HTTP Digest mechanism requires a certificate from a certification authority.
4. Form-based authentication is more secure than the HTTP basic authentication.

for this answer 1 should be correct.Because 2 is not possible,because if there are no <http-method> then all the methods are constrained for that resource.
Option 3 cannot be correct because,only CLIENT-CERT requires authentication.
Option 4 cannot be correct because,both Form-based authentication and HttpBasic Authentication transmits passwords without any encoding.Hence both are weak.Form based can only give a User defined Login page.That's it.
Hence Option 1 should be correct.


3.The tag handler class of this tag extends from TagSupport. If EVAL_BODY_BUFFERED is returned from doStartTag(), what will be the result of accessing this jsp? (Select one choice.)

1. code does not compile
2. code causes an exception at runtime
3. body of the tag is not evaluated, so no output
4. prints "hello"
5. none of the above
As per JSP SPECS JSP.13.1.5 TagSupport, BodyTag Support is a Direct SubClass of TagSupport.But in TagSupport,it cannot return EVAL_BODY_BUFFERED.It can only return either SKIP_BODY.

Hence I feel that Option 2 will be the correct answer.

Please correct me if I am wrong.

Thanks a lot.


Regards,<br /> <br />Satheesh.K<br />-------------<br />SCJP 1.4<br />SCWCD 1.4
satheesh krishnaswamy
Ranch Hand

Joined: Mar 17, 2004
Posts: 137
Please read this
Option 3 cannot be correct because,only CLIENT-CERT requires authentication.



as Option 3 cannot be correct because,only CLIENT-CERT requires Certificate.
Vishwas Hegde
Ranch Hand

Joined: Oct 02, 2003
Posts: 212

Intercepting filter is the answer for the question 1.


No.
Answer is business Delegate

Regards
Vishwas Hegde
SCJP 1.4
SCJA
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026

No.
Answer is business Delegate


The question is about additional layer between client and server.

When a request is made by a client and if there is a Filter then the request has to pass through the filter. Which means there is an additional layer between client and server.

Business Delegate is NOT correct. Because it adds a layer between Controller(servlet) and Remote model component(model residing in different VM).
P Chittaranjan
Ranch Hand

Joined: Feb 09, 2006
Posts: 47
Hi

For question 2 answere should de "Compilation fail".

Beacause we are using TagSupport class which implements IterationTag interface which extends Tag interface.

EVAL_BODY_BUFFERED is not defined in Tag interface as well in IterationTag interface. EVAL_BODY_BUFFERED is declared in BodyTag interface.

Scince TagSupport class in not inherited from BodyTag, we will not find the EVAL_BODY_BUFFERED constant up in the hierarchy.

So jsp page will fail to compile.

Thanks
Chittaranjan


Thanks,<br />Chittaranjan<br />SCJP 5.0,SCWCD1.4,SCBCD 5
P Chittaranjan
Ranch Hand

Joined: Feb 09, 2006
Posts: 47
Sorry , that expalnation is for Question 3.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Question 1 depends on your definition of "client". For the SCWCD you are to assume that it means the user. On the SCBCD, client usually means "caller to the EJB container", in which case Bus Del would be correct.

For the SCWCD, Vishnu is correct.


A good workman is known by his tools.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mock Questions