God Gave Me Nothing I Wanted<br />He Gave Me Everything I Needed<br /> - Swami Vivekananda
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.![]()
Originally posted by Chandra Sagi:
Hope this helps.
Thanks
Chandu
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?
SCJP 5 |SCWCD 5| Started thinking about Web Services ?
[My Blog]
All roads lead to JavaRanch
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
|