Given the definition of MyServlet: 11.public class MyServlet

题目
单选题
Given the definition of MyServlet: 11.public class MyServlet extends HttpServlet { 12.public void service(HttpServletRequest request, 13.HttpServletResponse response) 14.throws ServletException, IOException { 15.HttpSession session = request.getSession(); 16.session.setAttribute("myAttribute","myAttributeValue"); 17.session.invalidate(); 18.response.getWriter().println("value=" + 19.session.getAttribute("myAttribute")); 20.} 21.} What is the result when a request is sent to MyServlet?()
A

An IllegalStateException is thrown at runtime.

B

An InvalidSessionException is thrown at runtime.

C

The string value=null appears in the response stream.

D

The string value=myAttributeValue appears in the response stream.

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Exhibit:You are creating a composite control for capturing user address information in a Web application. You define a number of properties that the user can set at design time. You need to group these properties in the Properties dialog box. In addition, you need to ensure that when users click on a particular property, they receive a short explanation of that property. The properties are shown in the exhibit. Which two actions should you perform?()

A. Attach the Category attribute class to the controls class definition. Set its value to UserAddress. Mark the class as public.

B. Attach the Browsable attribute class to each property in the group. Set its value to True. Mark the property as private.

C. Attach the Category attribute class to each property in the group. Set its value to UserAddress. Mark the property as public.

D. Attach the Description attribute class to each property in the group. Set each value to a description of the given property.

E. Attach the DefaultProperty attribute class to each property in the group. Set each value to a description of the given property.


参考答案:C, D

第2题:

Given:http://com.example/myServlet.jsp?num=one&num=two&num=three.Whichtwoproducetheoutput"one,twoandthree"?()

A.${param.num[0],[1]and[2]}

B.${paramValues[0],[1]and[2]}

C.${param.num[0]},${param.num[1]}and${param.num[2]}

D.${paramValues.num[0]},${paramValues.num[1]}and${paramValues.num[2]}

E.${paramValues["num"][0]},${paramValues["num"][1]}and${paramValues["num"][2]}


参考答案:D, E

第3题:

_____ time, he’ll make a fist-class tennis player.

A、Having given

B、To give

C、Giving

D、Given


标准答案:D

第4题:

Given:Which statement is true about the class of an object that can reference the variable base? ()

A.It can be any class.

B.No class has access to base.

C.The class must belong to the geometry package.

D.The class must be a subclass of the class Hypotenuse.


参考答案:C

第5题:

Given:10. interface Data { public void load(); }11. abstract class Info { public abstract void load(); }Which class correctly uses the Data interface and Info class?()()

A.

B.

C.

D.

E.

F.


参考答案:A

第6题:

WhichthethreearevalidURLmappingstoaservletinawebdeploymentdescriptor?()

A.*/*

B./*.do

C.myServlet

D./Myservlet

E./MyServlet/*

F.MyServlet/*.isp


参考答案:B, D, E

第7题:

Given:What can directly access and change the value of the variable name?()

A. any class

B. only the Target class

C. any class in the test package

D. any class that extends Target


参考答案:C

第8题:

Please find the exact definition for "perception".

A. the way you think about something your idea of what it is like

B. a class on a particular subject,usually given as a form. of training

C. a place where an organized meeting ,concert,etc.takes place

D. the level of confidence and positive feelings that people hav


正确答案:A

第9题:

Given:Which two, inserted at line 11, will allow the code to compile?()

A.public class MinMax<?> {

B.public class MinMax<? extends Number> {

C.public class MinMax<N extends Object> {

D.public class MinMax<N extends Number> {

E.public class MinMax<? extends Object> {

F.public class MinMax<N extends Integer> {


参考答案:D, F

第10题:

( ) is an important concept since it allows reuse of a class definition without requiring major code changes.

A. InheritanceB. PolymorphismC. EncapsulationD. Data hiding


正确答案:A

更多相关问题