单项选择题
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");
相关考题
-
多项选择题
WhichtwostatementsaretrueaboutusingtheisUserInRolemethodtoimplementsecurityinaJavaEEapplication?()
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. -
多项选择题
Whichtwoarerequiredelementsfortheelementofawebapplicationdeploymentdescriptor?()
A.<realm-name>
B.<url-pattern>
C.<description>
D.<web-resource-name>
E.<transport-guarantee> -
单项选择题
Whichelementofawebapplicationdeploymentdescriptorelementisrequired?()
A.<realm-name>
B.<auth-method>
C.<security-role>
D.<transport-guarantee>
E.<web-resource-collection>
