多項(xiàng)選擇題

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?()

A.long customerOID = 47L;session.setAttribute("customerOID", new Long(customerOID));
B.long customerOID = 47L;session.setLongAttribute("customerOID", new Long(customerOID));
C.long customerOID = 47L;session.setAttribute("customerOID", customerOID);
D.long customerOID = 47L;session.setNumericAttribute("customerOID", new Long(customerOID));


您可能感興趣的試卷

你可能感興趣的試題

2.多項(xiàng)選擇題

A developer wants to make a name attribute available to all servlets associated with a particular user,across multiple requests from that user, from the same browser instance.
Which two provide this capability from within a tag handler?()

A.pageContext.setAttribute("name", theValue)
B.pageContext.setAttribute("name", getSession())
C.pageContext.getRequest().setAttribute("name", theValue)
D.pageContext.getSession().setAttribute("name", theValue)
E.pageContext.setAttribute("name", theValue,PageContext.PAGE_SCOPE)
F.pageContext.setAttribute("name", theValue,PageContext.SESSION_SCOPE)

3.單項(xiàng)選擇題

Click the Exhibit button.

The resource requested by the RequestDispatcher is available and implemented by the Destination Servlet.
What is the result?()

A.An exception is thrown at runtime by SourceServlet.
B.An exception is thrown at runtime by DestinationServlet.
C.Only "hello from dest" appears in the response output stream.
D.Both "hello from source" and "hello from dest" appear in the response output stream.

4.多項(xiàng)選擇題

You want to create a filter for your web application and your filter will implement javax.servlet.Filter.
Which two statements are true?()

A.Your filter class must implement an init method and a destroy method.
B.Your filter class must also implement javax.servlet.FilterChain.
C.When your filter chains to the next filter, it should pass the same arguments it received in its doFiltermethod.
D.The method that your filter invokes on the object it received that implements javax.servlet.FilterChaincan invoke either another filter or a servlet.
E.Your filter class must implement a doFilter method that takes, among other things, anHTTPServletRequest object and an HTTPServletResponse object.

5.多項(xiàng)選擇題

A developer wants a web application to be notified when the application is about to be shut down.
Which two actions are necessary to accomplish this goal?()

A.Include a listener directive in a JSP page
B.configure a listener in the TLD file using the  element
C.Include a  element in the web application deployment descriptor
D.configure a listener in the application deployment descriptor, using the  element
E.Include a class implementing ServletContextListener as part of the web application deploymen

最新試題

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?

題型:?jiǎn)雾?xiàng)選擇題

Click the ’Select and Place’ button.Place the events in the order they occur.

題型:?jiǎn)柎痤}

Click the 'Select and Place' button.Place the events in the order they occur.

題型:?jiǎn)柎痤}

You are building a dating service web site. Part of the form to submit a client’s profile is a groupIIof radio buttons for the person’s hobbies:20.<input type=’radio’ name=’hobbyEnum’ value=’HIKING’>Hiking <br>21.<input type=’radio’ name=’hobbyEnum’ value=’SKIING’>Skiing <br>22.<input type=’radio’ name=’hobbyEnum’ value=’SCUBA’>SCUBA Diving23.<!-- and more options -->After the user submits this form, a confirmation screen is displayed with these hobbies listed. Assume thatan application-scoped variable, hobbies, holds a map between the Hobby enumerated type and the displayname.Which EL code snippet will display Nth element of the user’s selected hobbies?()

題型:?jiǎn)雾?xiàng)選擇題

Which three are true about servlet filters?()

題型:多項(xiàng)選擇題

Which is true about the web container request processing model?()

題型:?jiǎn)雾?xiàng)選擇題

All of your JSPs need to have a link that permits users to email the web master. This web application islicensed to many small businesses, each of which have a different email address for the web master. Youhave decided to use a context parameter that you specify in the deployment descriptor, like this:42.<context-param>43.<param-name>webmasterEmail</param-name>44.<param-value>master@example.com</param-value>45.</context-param>Which JSP code snippet creates this email link?()

題型:?jiǎn)雾?xiàng)選擇題

Click the ’Select and Place’ button.Place the events in the order they occur.

題型:?jiǎn)柎痤}

Your company has a corporate policy that prohibits storing a customer’s credit card number in anycorporate database. However, users have complained that they do NOT want to re- enter their credit cardnumber for each transaction. Your management has decided to use client-side cookies to record the user’scredit card number for 120 days. Furthermore, they also want to protect this information during transit fromthe web browser to the web container; so the cookie must only be transmitted over HTTPS.Which codesnippet creates the "creditCard" cookie and adds it to the out going response to be stored on the user’s webbrowser?()

題型:?jiǎn)雾?xiàng)選擇題

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? ()

題型:多項(xiàng)選擇題