【单选题】现在session中没有任何属性,阅读下面2个JSP中的代码,将分别输出()。 <% out.println(session.getAttribute("svse")); %> <% session.invalidate(); out.println(session.getAttribute("svse")); %>A.null, 异常信息B.null, nullC.异常信息,异常信息D.异常信息,null

【单选题】现在session中没有任何属性,阅读下面2个JSP中的代码,将分别输出()。 <% out.println(session.getAttribute("svse")); %> <% session.invalidate(); out.println(session.getAttribute("svse")); %>

A.null, 异常信息

B.null, null

C.异常信息,异常信息

D.异常信息,null


参考答案和解析
B

相关考题:

要在session对象中保存属性,可以使用session.getAttribute("key","value")语句。() 此题为判断题(对,错)。

在JSP页面中的输出语句是()。A、System.out.print()B、Println()C、Out.println()D、Out.printValues()

GiventhatsessionisavalidHttpSessionobject:Intmax=session.getAttribute(MyReallyLongName”);Whichistrue?() A.Thevaluereturnedneedstobecasttoanint.B.ThegetAttributemethostakestwoarguments.C.PrimitiveCANNOTbestoredintheHttpSession.D.TheHttpSessionattributenamemustNOTexceedeightcharacters.

Youneedtostoreafloatingpointnumber,calledTsquare,inthesessionscope.Whichtwocodesnippetsallowyoutoretrievethisvalue?() A.floatTsquare=session.getFloatAttribute(Tsquare);B.floatTsquare=(Float)session.getAttribute(Tsquare);C.floatTsquare=(float)session.getNumericAttribute(Tsquare);D.floatTsquare=((Float)session.getAttribute.(Tsquare)).floatValue();E.floatTsquare=((Float)session.getFloatAttribute.(Tsquare)).floatValue;

阅读下列代码: public class Test{ public static void main(String args[])[ System. out.println(89>>1 ); } }A.44B.45C.88D.90

在J2EE中,重定向到另一个页面,以下()语句是正确的。 A.request.sendRedirect(“http://www.svse.com.cn”);B.request.sendRedirectt();C.response.sendRedirect(“http://www.svse.com.cn”);D.response.sendRedirect();

request.setAttribute("user","svse");session.setAttribute("user","bob");使用{user}则显示 A.nullB.svseC.bobD.啥也没有

在JSP中,只有一行代码:${1+2},运行将k输出() A.1+2B.3C.nullD.没有任何输出,因为表达式是错误的

jsp session问题 请教下,jsp中如何写一个session将数据保存在session中,由于是新手,麻烦写段简单的代码实例。

以下()可用于检索session属性userid的值。A、session.getAttribute(“userid”)B、session.setAttribute(“userid”)C、request.getParameter(“userid”)D、request.getAttribute(“userid”)

下面语句中,正确的是()A、public.class.AddAction.implements.Action{...B、mapping.findForward("/ch01/result.jsp")C、form.method="get"action="add.do"D、action.name="addAction"path="/add"type="com.svse.web.action.AddAction"

下列操作Session时,代码错误的是()A、HttpSession session=request.getSession(true);B、Session session=new Session();C、session.setAttribute("username","admin");D、String username=(String)session.getAttribute("username");E、response.add Session(Session);

对如下JSP 代码说法正确的是()。 %  Sring str = ”Hello.JBIT!”;  session.setAttribute(“msg’,str);  String getStr = session.getAttribute(“msg”);   out.println(getStr);  % A、 运行成功,页面上输出Hello.JBIT; B、 运行成功,页面上输出msg; C、 代码行session.setAttribute(“msg’,str);有错误,无法运行 D、 代码行String getStr = session.getAttribute(“msg”);有错误,无法运行

Jsp内嵌对象session的类型为javax.servlet.http. HttpSession,下述语句会使该对象失效的是() A、session.dispose()B、session.clear()C、session.invalidate()D、session.removeAll()

在JSP中,只有一行代码:%=AB%,运行将输出()。A、ABB、113C、没有任何输出,因为表达式是错误的

在某个JSP页面中存在这样一行代码,%= “2” + “4” % 运行该JSP后,以下说法正确的是()。A、这行代码没有对应的输出B、这行代码对应的输出时6C、这行代码对应的输出时24D、这行代码将引发错误

下面哪个方法可使session无效() A、session.setAttribute()B、session.getAttribute()C、session.invalidate()D、session.removeAttribute()

要在session对象中保存属性,可以使用以下哪个语句?()A、session.getAttribute(“key”,”value”)B、session.setAttribute(“key”,”value”)C、session.setAtrribute(“key”)D、session.getAttribute(“key”)

以下()是错误的JSP页面的表达方式。A、〈%! int a; %〉B、〈%= "Hello" %〉C、〈%= "world"; %〉D、〈% out.println("jsp"); %〉

Given that session is a valid HttpSession object:   Int max = session.getAttribute(“MyReallyLongName”);   Which is true?()  A、 The value returned needs to be cast to an int.B、 The getAttribute methos takes two arguments.C、 Primitive CANNOT be stored in the HttpSession.D、 The HttpSession attribute name must NOT exceed eight characters.

单选题对如下JSP 代码说法正确的是()。A 运行成功,页面上输出Hello.JBIT; B 运行成功,页面上输出msg; C 代码行session.setAttribute(“msg’,str);有错误,无法运行 D 代码行String getStr = session.getAttribute(“msg”);有错误,无法运行

单选题在JSP中,只有一行代码:,运行将输出()。AABB113C没有任何输出,因为表达式是错误的

多选题下列操作Session时,代码错误的是()AHttpSession session=request.getSession(true);BSession session=new Session();Csession.setAttribute(username,admin);DString username=(String)session.getAttribute(username);Eresponse.add Session(Session);

多选题下面语句中,正确的是()Apublic.class.AddAction.implements.Action{...Bmapping.findForward(/ch01/result.jsp)Cform.method=getaction=add.doDaction.name=addActionpath=/addtype=com.svse.web.action.AddAction

单选题在某个JSP页面中存在这样一行代码, 运行该JSP后,以下说法正确的是()。A这行代码没有对应的输出B这行代码对应的输出时6C这行代码对应的输出时24D这行代码将引发错误

单选题以下()是错误的JSP页面的表达方式。A〈%! int a; %〉B〈%= Hello %〉C〈%= world; %〉D〈% out.println(jsp); %〉

单选题Given that session is a valid HttpSession object:   Int max = session.getAttribute(“MyReallyLongName”);   Which is true?()A The value returned needs to be cast to an int.B The getAttribute methos takes two arguments.C Primitive CANNOT be stored in the HttpSession.D The HttpSession attribute name must NOT exceed eight characters.

单选题在JSP中,只有一行代码:${1+2},运行将输出()。A1+2B3CnullD没有任何输出,因为表达式是错误的