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?()
第1题:
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?()
第2题:
Given that c is a reference to a valid java.io.Console object, which two code fragments read a line of text from the console?()
第3题:
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?()
第4题:
Given the following code: 1) class Parent { 2) private String name; 3) public Parent(){} 4) } 5) public class Child extends Parent { 6) private String department; 7) public Child() {} 8) public String getValue(){ return name; } 9) public static void main(String arg[]) { 10) Parent p = new Parent(); 11) } 12) } Which line will cause error?()
第5题:
Which HttpSession method stores an object in a session?()
第6题:
Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) Which three statements inserts a row into the table? ()
第7题:
Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) Which three statements insert a row into the table? ()
第8题:
Given: 10. class One { 11. void foo() { } 12. } 13. class Two extends One { 14. //insert method here 15. } Which three methods, inserted individually at line 14, will correctly complete class Two?()
第9题:
The value returned needs to be cast to an int.
The getAttribute methos takes two arguments.
Primitive CANNOT be stored in the HttpSession.
The HttpSession attribute name must NOT exceed eight characters.
第10题:
final
static
native
public
private
第11题:
HttpSession session = request.getSession();
HttpSession session = request.getSession(id);
HttpSession session = request.getSession(true);
HttpSession session = request.getSession(false);
HttpSession session = request.getSession(jsessionid);
第12题:
chain.forward(request, response);
chain.doFilter(request, response);
request.forward(request, response);
request.doFilter(request, response);
第13题:
1. public class Employee { 2. String name; 3. double baseSalary; 4. Employee(String name, double baseSalary) { 5. this.name = name; 6. this.baseSalary = baseSalary; 7. } 8. } And: 1. public class Salesperson extends Employee { 2. double commission; 3. public Salesperson(String name, double baseSalary, 4. double commission) { 5. // insert code here 6. } 7. } Which code, inserted at line 7, completes the Salesperson constructor?()
第14题:
Given the uncompleted code of a class: class Person { String name, department; int age; public Person(String n){ name = n; } public Person(String n, int a){ name = n; age = a; } public Person(String n, String d, int a) { // doing the same as two arguments version of constructor // including assignment name=n,age=a department = d; } } Which expression can be added at the "doing the same as..." part of the constructor?()
第15题:
Given: 10.public void service(ServletRequest request, 11.ServletResponse response) { 12.ServletInputStream sis = 13.// insert code here 14.} Which retrieves the binary input stream on line 13?()
第16题:
Given the JSP code: <% request.setAttribute("foo", "bar"); %>and the Classic tag handler code: 5. public int doStartTag() throws JspException { 6. // insert code here 7. // return int 8. } Assume there are no other "foo" attributes in the web application. Which invocation on the pageContextobject,inserted at line 6,assigns "bar" to the variable x?()
第17题:
Given that session is a valid HttpSession object: Int max = session.getAttribute(“MyReallyLongName”); Which is true?()
第18题:
Which three statements inserts a row into the table?()
第19题:
Given that c is a reference to a valid java.io.Console object,which two code fragments read a line of textfrom the console?()
第20题:
Given 11.public interface Status { 12./* insert code here */ int MY_VALUE = 10; 13.} Which three are valid on line 12?()
第21题:
line 3
line 6
line 7
line 8
line 10
第22题:
put(String name. Object value)
set(String name. Object value)
setAttribute(String name. Object value)
putAttribute(String name. Object value)
addAttribute(String name. Object value)
第23题:
HttpSession session = request.getSession();
HttpSession session = request.getSession(id);
HttpSession session = request.getSession(true);
HttpSession session = request.getSession(false);
HttpSession session = request.getSession(jsessionid);