单选题 What is the result()?
Compilation will succeed.
Compilation will fail at line 5.
Compilation will fail at line 6.
Compilation will fail at line 14.
Compilation will fail at line 17.
单选题 Given an HttpServlet Request request and Http Servlet Response response, which sets a cookie “username” with the value “joe” in a servlet.?()
request.add Cookie (“username”. “joe”)
request.set Cookie (“username, “joe”)
response.add Cookie (username”, “joe”))
request.add Header (new Cookie (“username”, “joe”))
request.add Cookie (new Cookie (“username”, “joe”))
response.add Cookie (new Cookie (“username”, “joe”))
response.add Header (new Cookie (“username”, “joe”))
单选题 Given an EL function foo, in namespace func, that requires a long as a parameter and returns a Map, which two are valid invocations of function foo?()
${func(1)}
${foo:func(4)}
${func:foo(2)}
${foo(5):func}
${func:foo(“easy”)}
${func:foo(“3”).name}
多选题 For a given Servlet Response response, which two retrieve an object for writing text data? ()
response.get Writer ()
response.get Output Stream ()
response.get Output Writer ()
response.get Writer ().get Output Stream()
response.get Writer (Writer.OUTPUT_TEXT)
单选题 When using Form Based Authentication, which pair of fields must be used in the login form?()
j_user and j_id
j_id and j_password
j_users and j_password
j_user and j_password
j_login and j_password
j_username and j_password
多选题 Given a header in an HTTP request: X-Retries:4 Which two retrieve the value of the header from a given ServletRequest request? ()
request.getHeader (“X-Retries”)
request.getIntHeader (“X-Retries”)
request.getRequestHeader (“x-Retries”)
request.getHeaders (“X-Retries”).get (0)
re request.getRequest Headers (“X-Retries”). Get (0)
单选题 Which retrieves all cookies sent in a given HttpSErvletRequest request?()
request.getCookies()
request.getAttributes()
request.getSession ().getCookies()
request.getSession (). GetAttributes()
单选题 What is the result when a request is sent to MyServlet?()
An IllegalStateException is thrown at runtime.
An InvalidSessionException is thrown at runtime.
The string “value=null” appears in the response stream.
The string “value=myAttributeValue” appears in the response stream.
多选题 Under what two circumstances is the set JspBody method NOT called in a tag class that implements the Simple Tag interface? ()
The tag is invoked without a body.
The doTAb method throws an exception.
The
The tag is called with the attribute skip-body=true
多选题 Which two are true?()
The function method must have the signaturepublic: String spin().
The method must be mapped to the logical name “spin” in the web.xml file.
The function method must have the signature:public String spinIt().
The function method must have the signature:public static String spin().
The function method must have the signature:public static String spinIT().
The function class must be named Spinner, and must be in the package com.example.