Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Please answer me this question.

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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.
 
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Question4
----------

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

Thanks...
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

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
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

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
 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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
 
Ranch Hand
Posts: 340
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Q4) A & D
Q17) F(i am not very sure)
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I agree with Chandran Satheesh along with his correction for #4
 
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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 ]
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Closed as source of questions is unknown. (Send me a message if you know the source)
 
I will open the floodgates of his own worst nightmare! All in a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
    Bookmark Topic Watch Topic
  • New Topic