多項選擇題Which two classes or interfaces provide a getSession method?()

A.javax.servlet.http.HttpServletRequest
B.javax.servlet.http.HttpSessionContext
C.javax.servlet.http.HttpServletResponse
D.javax.servlet.http.HttpSessionBindingEvent
E.javax.servlet.http.HttpSessionAttributeEvent


您可能感興趣的試卷

你可能感興趣的試題

1.單項選擇題

Users of your web application have requested that they should be able to set the duration of their sessions.So for example, one user might want a webapp to stay connected for an hour rather than the webapp’sdefault of fifteen minutes; another user might want to stay connected for a whole day. Furthermore, youhave a special login servlet that performs user authentication and retrieves the User object from the database. You want to augment this code to set up the user’s specified session duration.
Which codesnippet in the login servlet will accomplish this goal?()

A.User user = // retrieve the User object from the database session.setDurationInterval(user.getSessionDuration());
B.User user = // retrieve the User object from the database session.setMaxDuration(user.getSessionDuration());
C.User user = // retrieve the User object from the database session.setInactiveInterval(user.getSessionDuration());
D.User user=//retrieve the User object from the database session.setDuration(user.getSessionDuratio());
E.User user = // retrieve the User object from the database session.setMaxInactiveInterval(user.getSessionDuration());

2.單項選擇題

Which method must be used to encode a URL passed as an argument to HttpServletResponse.sendRedirect when using URL rewriting for session tracking?()

A.ServletResponse.encodeURL
B.HttpServletResponse.encodeURL
C.ServletResponse.encodeRedirectURL
D.HttpServletResponse.encodeRedirectURL

3.單項選擇題Which interface must a class implement so that instances of the class are notified after any object is addedto a session?()

A.javax.servlet.http.HttpSessionListener
B.javax.servlet.http.HttpSessionValueListener
C.javax.servlet.http.HttpSessionBindingListener
D.javax.servlet.http.HttpSessionAttributeListener

4.單項選擇題

In your web application,you need to execute a block of code whenever the session object is first created.
Which design will accomplish this goal?()

A.Create an HttpSessionListener class and implement the sessionInitialized method with that block ofcode.
B.Create an HttpSessionActivationListener class and implement the sessionCreated method with thatblock of code.
C.Create a Filter class, call the getSession(false) method, and if the result was null, then execute that block of code.
D.Create an HttpSessionListener class and implement the sessionCreated method with that block of code.

5.單項選擇題What is the purpose of session management?()

A.To manage the user’s login and logout activities.
B.To store information on the client-side between HTTP requests.
C.To store information on the server-side between HTTP requests.
D.To tell the web container to keep the HTTP connection alive so it can make subsequent requestswithout the delay of making the TCP connection.

最新試題

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

題型:問答題

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?

題型:單項選擇題

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

題型:問答題

A web browser need NOT always perform a complete request for a particular page that it suspects mightNOT have changed. The HTTP specification provides a mechanism for the browser to retrieve only a partialresponse from the web server; this response includes information, such as the Last-Modified date but NOTthe body of the page.Which HTTP method will the browser use to retrieve such a partial response?()

題型:單項選擇題

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

題型:單項選擇題

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

題型:問答題

In which three directories, relative to a web application’s root, may a tag library descriptor file reside whendeployed directly into a web application?()

題型:多項選擇題

Which element of a web application deployment descriptor  element is required?()

題型:單項選擇題

The JSP developer wants a comment to be visible in the final output to the browser.Which comment styleneeds to be used in a JSP page?()

題型:單項選擇題

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

題型:問答題