Friday, 16 December 2011

SCWCD Questions 51- 60


QUESTION NO: 51


You have created a web application that you license to real estate brokers. The webapp is highly
customizable including the email address of the broker, which is placed on the footer of each
page. This is configured as a context parameter in the deployment descriptor:
10. <context-param>
11. <param-name>footerEmail</param-name>
12. <param-value>joe@estates-r-us.biz</param-value>
13. </context-param>
Which EL code snippet will insert this context parameter into the footer?
A. <a href='mailto:${footerEmail}'>Contact me</a>
B. <a href='mailto:${initParam@footerEmail}'>Contact me</a>
C. <a href='mailto:${initParam.footerEmail}'>Contact me</a>
D. <a href='mailto:${contextParam@footerEmail}'>Contact me</a>
E. <a href='mailto:${contextParam.footerEmail}'>Contact me</a>

Answer: C


QUESTION NO: 52


Given an EL function foo, in namespace func, that requires a long as a parameter and returns a
Map, which two are valid invocations of function foo? (Choose two.)
A. ${func(1)}
B. ${foo:func(4)}
C. ${func:foo(2)}
D. ${foo(5):func}
E. ${func:foo("easy")}
F. ${func:foo("3").name}

Answer: C,F


QUESTION NO: 53


Click the Exhibit button.
The Appliance class is a Singleton that loads a set of properties into a Map from an external data
source. Assume:
An instance of the Appliance class exists in the application-scoped attribute, appl
The appliance object includes the name property that maps to the value Cobia
The request-scoped attribute, prop, has the value name.
Which two EL code snippets will display the string Cobia? (Choose two.)
A. ${appl.properties.name}
B. ${appl.properties.prop}
C. ${appl.properties[prop]}
D. ${appl.properties[name]}
E. ${appl.getProperties().get(prop)}
F. ${appl.getProperties().get('name')}

Answer: A,C

QUESTION NO: 54

Squeaky Beans Inc. hired an outside consultant to develop their web application. To finish the job
quickly, the consultant created several dozen JSP pages that directly communicate with the
database. The Squeaky business team has since purchased a set of business objects to model
their system, and the Squeaky developer charged with maintaining the web application must now
refactor all the JSPs to work with the new system. Which pattern can the developer use to solve
this problem?


A. Transfer Object
B. Service Locator
C. Intercepting Filter
D. Business Delegate

Answer: D


QUESTION NO: 55


A developer is designing a web application that must verify for each request:
The originating request is from a trusted network.
The client has a valid session.
The client has been authenticated.
Which design pattern provides a solution in this situation?
A. Transfer Object
B. Session Facade
C. Intercepting Filter
D. Template Method
E. Model-View-Controller

Answer: C


QUESTION NO: 56


The Squeaky Bean company has decided to port their web application to a new J2EE 1.4
container. While reviewing the application, a developer realizes that in multiple places within the
current application, nearly duplicate code exists that finds enterprise beans. Which pattern should
be used to eliminate this duplicate code?
A. Transfer Object
B. Front Controller
C. Service Locator
D. Intercepting Filter
E. Business Delegate
F. Model-View-Controller

Answer: C

QUESTION NO: 57


Which two are characteristics of the Transfer Object design pattern? (Choose two.)
A. It reduces network traffic by collapsing multiple remote requests into one.
B. It increases the complexity of the remote interface by removing coarse-grained methods.
C. It increases the complexity of the design due to remote synchronization and version control
issues.
D. It increases network performance introducing multiple fine-grained remote requests which
return very small amounts of data.

Answer: A,C


QUESTION NO: 58


A developer has created a special servlet that is responsible for generating XML content that is
sent to a data warehousing subsystem. This subsystem uses HTTP to request these large data
files, which are compressed by the servlet to save internal network bandwidth. The developer has
received a request from management to create several more of these data warehousing servlets.
The developer is about to copy and paste the compression code into each new servlet. Which
design pattern can consolidate this compression code to be used by all of the data warehousing
servlets?
A. Facade
B. View Helper
C. Transfer Object
D. Intercepting Filter
E. Composite Facade

Answer: D


QUESTION NO: 59


Which two are characteristics of the Service Locator pattern? (Choose two.)
A. It encapsulates component lookup procedures.
B. It increases source code duplication and decreases reuse.
C. It improves client performance by caching context and factory objects.
D. It degrades network performance due to increased access to distributed lookup services.

Answer: A,C

QUESTION NO: 60 DRAG DROP


Click the Task button.
Given a servlet mapped to /control, place the correct URI segment returned as a String on the
corresponding HttpServletRequest method call for the URI: /myapp/control/processorder.


Answer:



No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...