Given an HttpServletRequest request:
22.String id = request.getParameter("jsessionid");
23.// insert code here
24.String name = (String) session.getAttribute("name");
Which three can be placed at line 23 to retrieve anexisting HttpSession object?()
A.HttpSession session = request.getSession();
B.HttpSession session = request.getSession(id);
C.HttpSession session = request.getSession(true);
D.HttpSession session = request.getSession(false);
E.HttpSession session = request.getSession("jsessionid");
您可能感興趣的試卷
你可能感興趣的試題
201.private static final Set USE_CASE_ATTRS;
202.static {
203.USE_CASE_ATTRS.add("customerOID");
204.USE_CASE_ATTRS.add("custMgrBean");
205.USE_CASE_ATTRS.add("orderOID");
206.USE_CASE_ATTRS.add("orderMgrBean");
207.}
Which code snippet deletes these attributes from the session object?()
A.session.removeAll(USE_CASE_ATTRS);
B.for ( String attr : USE_CASE_ATTRS ) {session.remove(attr);}
C.for ( String attr : USE_CASE_ATTRS ) {session.removeAttribute(attr);}
D.for ( String attr : USE_CASE_ATTRS ) {session.deleteAttribute(attr);}
E.session.deleteAllAttributes(USE_CASE_ATTRS);
Given a portion of a valid Java EE web application’s directory structure:MyApp |
|--Directory1
||--File1.html|
|--META-INF|
|--File2.html|
|--WEB-INF
|--File3.html
You want to know whether File1.html, File2.html,and/or File3.html is protected from direct access by yourweb client’s browsers.
What statement is true?()
A.All three files are directly accessible.
B.Only File1.html is directly accessible.
C.Only File2.html is directly accessible.
D.Only File3.html is directly accessible.
Given:
11.<servlet>
12.<servlet-name>catalog</servlet-name>
13.<jsp-file>/catalogTemplate.jsp</jsp-file>
14.<load-on-startup>10</load-on-startup>
15.</servlet>
Which two are true?()
A.Line 13 is not valid for a servlet declaration.
B.Line 14 is not valid for a servlet declaration.
C.One instance of the servlet will be loaded at startup.
D.Ten instances of the servlet will be loaded at startup.
E.The servlet will be referenced by the name catalog in mappings.
A./classes
B./index.html
C./MANIFEST-INF
D./WEB-INF/web.xml
E./WEB-INF/classes
![](https://static.ppkao.com/ppmg/img/appqrcode.png)
最新試題
Click the 'Select and Place' button.Place the events in the order they occur.
Given tutorial.jsp:2.EL Tutorial3.Example 14.5.Dear ${my:nickname(user)}6.Which, when added to the web application deployment descriptor,ensures that line 5 is included verbatimin the JSP output?()
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.
A web application allows the HTML title banner to be set using a servlet context initialization parametercalled titleStr.Which two properly set the title in this scenario?()
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?()
Which is true about the web container request processing model?()
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?()
Which two are valid and equivalent?()
You need to create a JSP that generates some JavaScript code to populate an array of strings used on the client-side.Which JSP code snippet will create this array?()