• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mock Questions

 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Sunjeev Shetty
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is EVAL_BODY_BUFFERED a valid return value for doStartTag for a class that extends TagSupport?
 
Ranjani Theyagarajan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Intercepting filter is the answer for the question 1.
 
Sunjeev Shetty
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Business Delegate is the answer for the first question.
 
satheesh krishnaswamy
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
satheesh krishnaswamy
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
P Chittaranjan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry , that expalnation is for Question 3.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic