The Squeaky Bean company has decided to port their web application to a new J2EE 1.4 container. Whilereviewing the application, a developer realizes that in multiple places within the current application, nearlyduplicate code exists that finds enterprise beans.
Which pattern should be used to eliminate this duplicatecode?()
A.Transfer Object
B.Front Controller
C.Service Locator
D.Intercepting Filter
E.Business Delegate
F.Model-View-Controller
您可能感興趣的試卷
你可能感興趣的試題
A developer is designing a web application that must verify for each request: The originating request is froma 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
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 Squeakybusiness 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 newsystem.
Which pattern can the developer use to solve this problem?()
A.Transfer Object
B.Service Locator
C.Intercepting Filter
D.Business Delegate
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 valuename.
Which two EL code snippets will display the string Cobia?()
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’)}
A.${func(1)}
B.${foo:func(4)}
C.${func:foo(2)}
D.${foo(5):func}
E.${func:foo("easy")}
F.${func:foo("3").name}
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 isconfigured 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>
最新試題
Which three are true about servlet filters?()
Click the 'Select and Place' button.Place the events in the order they occur.
Which ensures that a JSP response is of type "text/plain"?()
Click the Exhibit button.The attribute "name" has a value of "Foo,"What is the result if this tag handler’s tag is invoked?()
Given a web application in which the request parameter productID contains a product identifier.Which twoEL expressions evaluate the value of the productID?()
You are building a dating web site. The client’s date of birth is collected along with lots of other information.The Person class has a derived method, getAge():int, which returns the person’s age calculated from thedate of birth and today’s date. In one of your JSPs you need to print a special message to clients within theage group of 25 through 35.Which two EL code snippets will return true for this condition? ()
Your IT department is building a lightweight Front Controller servlet that invokes an application logic objectwith the interface:public interface ApplicationController {public String invoke(HttpServletRequest request)}The return value of this method indicates a symbolic name of the next view. From this name, the FrontController servlet looks up the JSP URL in a configuration table. This URL might be an absolute path or apath relative to the current request. Next, the Front Controller servlet must send the request to this JSP togenerate the view. Assume that the servlet variable request is assigned the current HttpServletRequestobject and the variable context is assigned the webapp’s ServletContext. Which code snippet of the FrontController servlet accomplishes this goal?()
You are building a web application with a scheduling component. On the JSP, you need to show the currentdate, the date of the previous week, and the date of the next week. To help you present this information,you have created the following EL functions in the ’d’ namespace: name: curDate; signature: java.util.DatecurrentDate() name: addWeek; signature: java.util.Date addWeek(java.util.Date, int) name: dateString;signature:java.util.String getDateString(java.util.Date)Which EL code snippet will generate the string for the previousweek?
Given a Filter class definition with this method:21.public void doFilter(ServletRequest request,22.ServletResponse response,23.FilterChain chain)24.throws ServletException, IOException {25.// insert code here26.}Which should you insert at line 25 to properly invoke the next filter in the chain, or the target servlet if thereare no more filters?()
Click the ’Select and Place’ button.Place the events in the order they occur.