多选题 You want to create a filter for your web application and your filter will implement javax.servlet.Filter. Which two statements are true?()
Your filter class must implement an init method and a destroy method.
Your filter class must also implement javax.servlet.FilterChain.
When your filter chains to the next filter, it should pass the same arguments it received in its doFiltermethod.
The method that your filter invokes on the object it received that implements javax.servlet.FilterChaincan invoke either another filter or a servlet.
Your filter class must implement a doFilter method that takes, among other things, anHTTPServletRequest object and an HTTPServletResponse object.
单选题 Your web application uses a simple architecture in which servlets handle requests and then forward to aJSP using a request dispatcher. You need to pass information calculated by the servlet to the JSP;furthermore, that JSP uses a custom tag and must also process this information. This information mustNOT be accessible to any other servlet, JSP or session in the webapp. How can you accomplish this goal?()
Store the data in a public instance variable in the servlet.
Add an attribute to the request object before using the request dispatcher.
Add an attribute to the context object before using the request dispatcher.
This CANNOT be done as the tag handler has no means to extract this data.
单选题 For manageability purposes, you have been told to add a "count" instance variable to a critical JSP Document so that a JMX MBean can track how frequent this JSP is being invoked. Which JSP code snippetmust you use to declare this instance variable in the JSP Document?()
<jsp:declaration>int count = 0;<jsp:declaration>
<%! int count = 0; %>
<jsp:declaration.instance>int count = 0;. <jsp:declaration.instance>
<jsp:scriptlet.declaration>int count = 0;. <jsp:scriptlet.declaration>
多选题 Given: 11. 15. Which three EL expressions, inserted at line 15,are valid and evaluate to "3"?()
${vals.2}
${vals[2]}
${vals.index}
${vals[index]}
${vals}[index]
${vals[vals[index-1]]}
多选题 You need to store a Java long primitive attribute, called customerOID, into the session scope. Which two code snippets allow you to insert this value into the session?()
long customerOID = 47L;session.setAttribute(customerOID, new Long(customerOID));
long customerOID = 47L;session.setLongAttribute(customerOID, new Long(customerOID));
long customerOID = 47L;session.setAttribute(customerOID, customerOID);
long customerOID = 47L;session.setNumericAttribute(customerOID, new Long(customerOID));
单选题 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?()
Transfer Object
Front Controller
Service Locator
Intercepting Filter
Business Delegate
Model-View-Controller