单选题Given an HttpServletRequest request and HttpServletResponse response,which sets a cookie "username"with the value "joe" in a servlet?()A request.addCookie(username, joe)B request.setCookie(username, joe)C response.addCookie(username, joe)D request.addH

题目
单选题
Given an HttpServletRequest request and HttpServletResponse response,which sets a cookie "username"with the value "joe" in a servlet?()
A

request.addCookie(username, joe)

B

request.setCookie(username, joe)

C

response.addCookie(username, joe)

D

request.addHeader(new Cookie(username, joe))

E

request.addCookie(new Cookie(username, joe))

F

response.addCookie(new Cookie(username, joe))

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

第1题:

GivenanHttpServletRequestrequestandHttpServletResponseresponse,whichsetsacookie"username"withthevalue"joe"inaservlet?()

A.request.addCookie("username","joe")

B.request.setCookie("username","joe")

C.response.addCookie("username","joe")

D.request.addHeader(newCookie("username","joe"))

E.request.addCookie(newCookie("username","joe"))

F.response.addCookie(newCookie("username","joe"))


参考答案:F

第2题:

已知id为username的input输入框,希望获取这个输入框的输入值,怎么做()

A.document.getElement("username")

B.document.getElement("username").value

C.document.getElementById("username")

D.document.getElementById("username").value


参考答案:D

第3题:

创建一个Cookie的正确代码( )。

A、Response.Cookies["userName"]="apple"

B、Cookies["userName"]="apple"

C、Cookies["userName"].Value="apple"

D、Response.Cookies["userName"].Value="apple"


参考答案:D

第4题:

若要获得名为username的Cookie值,以下语句正确的是()。

A.Requst.Cookie(“username”)

B.Requst.Cookies(“username”)

C.ResponsE.Cookie(“username”)

D.ResponsE.Cookies(“username”)


参考答案:A

第5题:

Auserwiththeuseridof’joe’isunabletorshfromSYSTEMAtoSYSTEMBwithouthavingtoretypetheirpassword,buttheycanrshfromSYSTEMBtoSYSTEMA.Nootherusersareexperiencingthesameissue.Bothsystemshavea/home/joe/.rhostsfilethatcontaintheproperreferencestotheotherhost.The/home/joe/.rhostsfilesonbothSYSTEMAandSYSTEMBareownedbyuserid’joe’.Whichofthefollowingisthemostlikelycauseofthisproblem?()

A.User’joe’isspecifiedinthe/etc/nologinonSYSTEMA

B.User’joe’isspecifiedinthe/etc/nologinonSYSTEMB

C.Thefilepermissionsonthe/home/joe/.rhostsfileonSYSTEMAiscorrect.

D.Thefilepermissionsonthe/home/joe/.rhostsfileonSYSTEMBisincorrect.


参考答案:D

第6题:

GivenanHttpServletRequestrequestandHttpServletResponseresponse,whichsetsacookie“username”withthevalue“joe”inaservlet.?()

A.request.addCookie(“username”.“joe”)

B.request.setCookie(“username,“joe”)

C.response.addCookie(username”,“joe”))

D.request.addHeader(newCookie(“username”,“joe”))

E.request.addCookie(newCookie(“username”,“joe”))

F.response.addCookie(newCookie(“username”,“joe”))

G.response.addHeader(newCookie(“username”,“joe”))


参考答案:F

第7题:

Abankinguserwiththeuseridof’joe’isunabletorshfromSYSTEMAtoSYSTEMBwithouthavingtoretypetheirpassword,buttheycanrshfromSYSTEMBtoSYSTEMA.Nootherusersareexperiencingthesameissue.Bothsystemshavea/home/joe/.rhostsfilethatcontaintheproperreferencestotheotherhost.The/home/joe/.rhostsfilesonbothSYSTEMAandSYSTEMBareownedbyuserid’joe’.Whichofthefollowingisthemostlikelycauseofthisproblem()

A.User’joe’isspecifiedinthe/etc/nologinonSYSTEMb.

B.User’joe’isspecifiedinthe/etc/nologinonSYSTEMa.

C.Thefilepermissionsonthe/home/joe/.rhostsfileonSYSTEMAareincorrect.

D.Thefilepermissionsonthe/home/joe/.rhostsfileonSYSTEMBareincorrect.


参考答案:D

第8题:

GivenawebapplicationinwhichthecookieuserNameisexpectedtocontainthenameoftheuser.Which ELexpressionevaluatestothatusername?()

A.${userName}

B.${cookie.userName}

C.${cookie.user.name}

D.${cookies.userName[0]}


参考答案:B

第9题:

若要获得名为login表单中txtuser的文本输入框的值,以下方法正确的是()

A、username=login.txtuser.value

B、username=document.txtuser.value

C、username=document.login.txtuser

D、username=document.txtuser.value


答案:A

第10题:

Joe came to the window as the crowd chanted,"Joe!Joe!Joe!"

A:jumped
B:repeated
C:maintained
D:approached

答案:B
解析:
本句意思:乔走到了窗户那里,人们竞相喊叫着他的名字:“乔!乔!乔!”单词repeat意 思为“重复”,和chant(咏唱,反复有节奏地喊叫)意思接近。单词jump意思为“跳跃”;maintain 意思为“保持,维护”;approach意思为“接近,处理”。

更多相关问题