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 Please answer me this question. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply locked New topic
Author

Please answer me this question.

Kang Dae Chul
Greenhorn

Joined: Dec 30, 2005
Posts: 4
hi all.
I do not fully understand about the following questions.

QUESTION 4
A JSP page needs to instantiate a JavaBean to be used by only that page.
Which two jsp:useBean attribute must be used to access this attribute in the JSP
page? (Choose two)

A. id
B. type
C. name
D. class
E. scope
F. create

QUESTION 17
Which EL expression evaluates to the request URI?
A. ${requestURI}
b. ${request.URI}
c. ${request.getURI}
d. ${request.requestURI}
E. ${requestScope.requestURI}
F. ${pageContext.request.requestURI}
G. ${requestScope.request.request.URI}

QUESTION 26
A web component accesses a local EJB session session bean with a component interface of
com.example.Account with a home interface of com.example.AccountHome and a JNDI reference of ejb/Account.
Which makes the local EJB component accessible to the web components in the web application deployment descriptor?

A. <env-ref>
<ejb-ref-name>ejb/Account</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.exampleAccountHome</local-home>
<local>com.example.Account</local>
</env-ref>

B. <resource-ref>
<ejb-ref-name>ejb/Account</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.exampleAccountHome</local-home>
<local>com.example.Account</local>
</resource-ref>

C. <ejb-local-ref>
<ejb-ref-name>ejb/Account</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.exampleAccountHome</local-home>
<local>com.example.Account</local>
</ejb-local-ref>

D. <ejb-remote-ref>
<ejb-ref-name>ejb/Account</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.exampleAccountHome</local-home>
<local>com.example.Account</local>
</ejb-remote-ref>

QUESTION 200
White the design pattern about following :
- The originating request is from a trusted network
- The client has a valid session
- The client has been authentication

QUESTION 36
Which three are true about the HttpServletRequestWrapper class? (Choose three)
A. The HttpServletRequestWrapper is an example of the Decorator pattern.
B. The HttpServletRequestWrapper can be used to extend the functionally of a servlet request.
C. A subclass of HttpServletRequestWrapper CANNOT modify the behavior of the getReader method.
D. An HttpServletRequestWrapper may be used only by a class implementing the javax.servlet.Filter interface.
E. An HttpServletRequestWrapper CANNOT be used on the request passed to the RequestDispatcher.include method.
F. An HttpServletRequestWrapper may modify the header of a request within an object implementing the javax.sevlet.Filter interface.

QUESTION 38
A Mockexams.com developer is designing a multi-tier web application and discovers a need to log each incoming client reqeust.
Which two patterns, taken independently, provide a solution for this problem ? (Choose two)
A. Transfer Object
B. Service Locator
C. Front Controller
D. Intercepting Filter
E. Business Delegate
F. Model-View-Controller

QUESTION 45
The Squeaky Beans Inc. shopping application was initially developed for a nondistributed environment.
The company recently purchased the Acme Application Server, which supports distributed HttpSession objects.
When deploying the application to the server, the deployer marks it as distributable in the web application
deployment descriptor to take advantage of this feature.
Given this scenario, which two must be true? (Choose two)

A. The J2EE web container must support migration of objects that implement Serializable.
B. The J2EE web container must use the native JVM Serialization mechanism for distributing HttpSession objects.
C. As per the specification, the J2EE web container ensures that distributed HttpSession objects will be stored in a database.
D. Storing references to Enterprise JavaBeans components in the HttpSession object might NOT be supported by J2EE web containers.

QUESTION 47
Given :
3. public class MyTagHandler extends TagSupport {
4. public int doStartTag() {
5. // insert code here
6. // return an int
7. }
8. // more code here
...
18. }
There is a single attribute foo in the session scope.
Which three code fragments, inserted independently at line 5, return the value of the attributes? (Choose three)
A. Object o = pageContext.getAttribute("foo");
B. Object o = pageContext.findAttribute("foo");
C. Object o = pageContext.getAttribute("foo",PageContext.SESSION_SCOPE);
D. HttpSession s = pageContext.getSession();
Object o = s.getAttribute("foo");
E. HttpServletRequest r = pageContext.getRequest();
Object o = r.getAttribute("foo");



.. help me.
MInu
Ranch Hand

Joined: Oct 09, 2003
Posts: 517
Question4
----------

i think the correct answres are 'id' and 'name'.

Thanks...


God Gave Me Nothing I Wanted<br />He Gave Me Everything I Needed<br /> - Swami Vivekananda
Chandra Sagi
Ranch Hand

Joined: May 05, 2005
Posts: 162
Originally posted by Kang Dae Chul:
hi all.
I do not fully understand about the following questions.

QUESTION 4
A JSP page needs to instantiate a JavaBean to be used by only that page.
Which two jsp:useBean attribute must be used to access this attribute in the JSP
page? (Choose two)

A. id
B. type
C. name
D. class
E. scope
F. create


Ans) A & C as Vinod already said.

QUESTION 17
Which EL expression evaluates to the request URI?
A. ${requestURI}
b. ${request.URI}
c. ${request.getURI}
d. ${request.requestURI}
E. ${requestScope.requestURI}
F. ${pageContext.request.requestURI}
G. ${requestScope.request.request.URI}

Ans) F.

Use requestScope to get request Attibutes, not request properties. For request properties, you need to go through pageContext(pg - 384, HFSJ)

QUESTION 26
A web component accesses a local EJB session session bean with a component interface of
com.example.Account with a home interface of com.example.AccountHome and a JNDI reference of ejb/Account.
Which makes the local EJB component accessible to the web components in the web application deployment descriptor?

A. <env-ref>
<ejb-ref-name>ejb/Account</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.exampleAccountHome</local-home>
<local>com.example.Account</local>
</env-ref>

B. <resource-ref>
<ejb-ref-name>ejb/Account</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.exampleAccountHome</local-home>
<local>com.example.Account</local>
</resource-ref>

C. <ejb-local-ref>
<ejb-ref-name>ejb/Account</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.exampleAccountHome</local-home>
<local>com.example.Account</local>
</ejb-local-ref>

D. <ejb-remote-ref>
<ejb-ref-name>ejb/Account</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.exampleAccountHome</local-home>
<local>com.example.Account</local>
</ejb-remote-ref>


Ans) C

reference pg - 598 HFSJ

QUESTION 200
White the design pattern about following :
- The originating request is from a trusted network
- The client has a valid session
- The client has been authentication

Can you repeat this question. This is not clear.


QUESTION 36
Which three are true about the HttpServletRequestWrapper class? (Choose three)
A. The HttpServletRequestWrapper is an example of the Decorator pattern.
B. The HttpServletRequestWrapper can be used to extend the functionally of a servlet request.
C. A subclass of HttpServletRequestWrapper CANNOT modify the behavior of the getReader method.
D. An HttpServletRequestWrapper may be used only by a class implementing the javax.servlet.Filter interface.
E. An HttpServletRequestWrapper CANNOT be used on the request passed to the RequestDispatcher.include method.
F. An HttpServletRequestWrapper may modify the header of a request within an object implementing the javax.sevlet.Filter interface.


Ans) A,B and D(not sure about this one)


QUESTION 38
A Mockexams.com developer is designing a multi-tier web application and discovers a need to log each incoming client reqeust.
Which two patterns, taken independently, provide a solution for this problem ? (Choose two)
A. Transfer Object
B. Service Locator
C. Front Controller
D. Intercepting Filter
E. Business Delegate
F. Model-View-Controller


Ans) C & D.


QUESTION 45
The Squeaky Beans Inc. shopping application was initially developed for a nondistributed environment.
The company recently purchased the Acme Application Server, which supports distributed HttpSession objects.
When deploying the application to the server, the deployer marks it as distributable in the web application
deployment descriptor to take advantage of this feature.
Given this scenario, which two must be true? (Choose two)

A. The J2EE web container must support migration of objects that implement Serializable.
B. The J2EE web container must use the native JVM Serialization mechanism for distributing HttpSession objects.
C. As per the specification, the J2EE web container ensures that distributed HttpSession objects will be stored in a database.
D. Storing references to Enterprise JavaBeans components in the HttpSession object might NOT be supported by J2EE web containers.


Ans) A & B


QUESTION 47
Given :
3. public class MyTagHandler extends TagSupport {
4. public int doStartTag() {
5. // insert code here
6. // return an int
7. }
8. // more code here
...
18. }
There is a single attribute foo in the session scope.
Which three code fragments, inserted independently at line 5, return the value of the attributes? (Choose three)
A. Object o = pageContext.getAttribute("foo");
B. Object o = pageContext.findAttribute("foo");
C. Object o = pageContext.getAttribute("foo",PageContext.SESSION_SCOPE);
D. HttpSession s = pageContext.getSession();
Object o = s.getAttribute("foo");
E. HttpServletRequest r = pageContext.getRequest();
Object o = r.getAttribute("foo");


Ans) B,C and D.


.. help me.


Hope this helps.

Thanks
Chandu
Chandran Satheesh
Greenhorn

Joined: Dec 01, 2005
Posts: 2
Originally posted by Chandra Sagi:


Hope this helps.

Thanks
Chandu


Hey guys,

I would like to make a small correction for the answers give for the qn given below:
QUESTION 4
A JSP page needs to instantiate a JavaBean to be used by only that page.
Which two jsp:useBean attribute must be used to access this attribute in the JSP
page? (Choose two)

A. id
B. type
C. name
D. class
E. scope
F. create

Vinod specified A and C as answers.

A is correct but C is not. "name" is not the attribute of <jsp:usebean> rather it is the attribute of <jsp:get/setproperty>

Notice the quote "JSP page needs to instantiate a JavaBean", which is possible only if u specify the "class" attribute of <jsp:usebean>.

So, A and D are correct.

Thanks,

Satheesh
Saurabh Chaubey
Ranch Hand

Joined: Oct 16, 2005
Posts: 101
Hi,

The correct answer to Q 36 should be A,B and F.

The answer to Q200 looks like Intercepting Filter pattern.The description is not that elaborate so I am making a guess as All the three cases given can be checked for in a Filter.

Regards,
Saurabh
Sandeep Chhabra
Ranch Hand

Joined: Aug 28, 2005
Posts: 340
Q4) A & D
Q17) F(i am not very sure)


Regards<br />Sandy<br />[SCJP 5.0 - 75%]<br />[SCWCD 1.4 - 85%]<br />------------------<br />Tiger, Tiger burning bright,<br />Like a geek who works all night,<br />What new-fangled bit or byte,<br />Could ease the hacker's weary plight?
Vivek Kinra
Ranch Hand

Joined: Mar 11, 2006
Posts: 66
I agree with Chandran Satheesh along with his correction for #4
Amruth Puppala
Ranch Hand

Joined: Jul 14, 2008
Posts: 295
Again I replied to old post, sorry for that..

Hi latest ranchers is question 45 is correct?
[ August 12, 2008: Message edited by: Chintu sirivennela ]

SCJP 5 |SCWCD 5| Started thinking about Web Services ?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Closed as source of questions is unknown. (Send me a message if you know the source)


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Please answer me this question.
 
Similar Threads
Doubt in Final Mock Exam of HFEJB
IBM 287 ICE TEST
long post IBM.158
JNDI Lookup for a Local EJB in JBoss
Lookup pbm for a local EJB in JBOSS