A web application uses the HttpSession mechanism to determine if a user is "logged in." When a usersupplies a valid user name and password, an HttpSession is created for that user. The user has access tothe application for only 15 minutes after logging in. The code must determine how long the user has beenlogged in, and if this time is greater than 15 minutes, must destroy the HttpSession.
Which method in HttpSession is used to accomplish this?()
A.Getcreationtime
B.Invalidateafter
C.Getlastaccessedtime
D.Getmaxinactiveinterval
您可能感興趣的試卷
你可能感興趣的試題
Given an HttpServletRequest request and an HttpServletResponse response:
41.HttpSession session = null;
42.// insert code here
43.if(session == null) {
44.// do something if session does not exist
45.} else {
46.// do something if session exists47. }
To implement the design intent,which statement must be inserted at line 42?()
A.session = response.getSession();
B.session = request.getSession();
C.session = request.getSession(true);
D.session = request.getSession(false);
E.session = request.getSession("jsessionid");
A.It can be invoked only from the doGet or doPost methods.
B.It can be used independently of the getRemoteUser method.
C.Can return "true" even when its argument is NOT defined as a valid role name in the deployment descriptor.
D.Using the isUserInRole method overrides any declarative authentication related to the method in which it is invoked.
A.<realm-name>
B.<url-pattern>
C.<description>
D.<web-resource-name>
E.<transport-guarantee>
A.<realm-name>
B.<auth-method>
C.<security-role>
D.<transport-guarantee>
E.<web-resource-collection>
A.Every
B.A
C.A given tag can apply to only one
D.A given
E.It is possible to construct a valid
最新試題
Click the ’Select and Place’ button.Place the events in the order they occur.
You are building your own layout mechanism by including dynamic content for the page’s header and footersections. The footer is always static, but the header generates the <title> tag that requires the page name tobe specified dynamically when the header is imported.Which JSP code snippet performs the import of theheader content?()
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?()
Click the ’Select and Place’ button.Place the events in the order they occur.
Click the ’Select and Place’ button.Place the events in the order they occur.
Which is true about the web container request processing model?()
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?()
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? ()
Click the 'Select and Place' button.Place the events in the order they occur.
Click the ’Select and Place’ button.Place the events in the order they occur.