A.Using HTTPS as a protocol B.Using an LDAP security realm C.Using HTTP Basic authentication D.Using forms-based authentication
多项选择题Whichtwo classesorinterfacesprovideagetSessionmethod?()
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
单项选择题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());
单项选择题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
单项选择题Whichinterfacemustaclassimplementsothatinstancesoftheclassarenotifiedafteranyobjectisaddedtoasession?()
A.javax.servlet.http.HttpSessionListener B.javax.servlet.http.HttpSessionValueListener C.javax.servlet.http.HttpSessionBindingListener D.javax.servlet.http.HttpSessionAttributeListener
单项选择题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.