单项选择题
A developer is designing a web application which extensively uses EJBs and JMS.
The developer finds that there is a lot of duplicated code to build the JNDI contexts to access the beans and queues. Further, because of the complexity, there are numerous errors in the code.
Which J2EE design pattern provides a solution for this problem?()
A. Command
B. Transfer object
C. Service locator
D. Session Façade
E. Business delegate
F. Data access object
相关考题
-
多项选择题
Whichthe twoarecharacteristicsoftheServiceLocatorpattern?()
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 -
单项选择题
Assumethetaghandlerforast:simpletagextendsSimpleTagSupport.Inwhatwaycanscriptletcodebeusedinthebodyofst:simple?()
A. Set the body content type to JSP in the TLD
B. Scriptlet code is NOT legal in the body of st:simple
C. Add scripting-enabled= “true” to the start tag for the st:simple element
D. Add a pass-through Classic tag with a body content type of JSP to the body of st:simple, and place the scriptlet code in the body of that tag. -
单项选择题
The tag handler for n:recurse extends SimpleTagSupport.Assuming an n:recurse tag can either contain an empty body or another n:recurse tag, which strategy allows the tag handler for n:recurse to output the nesting depth of the deepest n:recurse tag?()
A. It is impossible to determine the deepest nesting depth because it is impossible for tag handlers that extend SimpleTagSupport to communicate with their parent and child tags
B. Create a private non-static attribute in the tag handler class called count of type int initialized to oIncrement count in the doTag method. If the tag has a body, invoke the fragment for that body. Otherwise, output the value of count
C. Start a counter at 1. Call getChildTags(). If it returns null, output the value of the counter. Otherwise, increment counter and continue from where getChildTags() is called. Skip processing of the body.
D. If the tag has a body, invoke the fragment for that body. Otherwise, start a counter at 1. Call getParent(). If it returns null, output the value of the counter. Otherwise, increment the counter and continue from where getParent() is called.
