CMS专题

多选题A session-scoped attribute is stored by a servlet, and then that servlet forwards to a JSP page. Which threejsp:useBean attributes must be used to access this attribute in the JSP page?()AidBnameCbeanDtypeEscope

题目
多选题
A session-scoped attribute is stored by a servlet, and then that servlet forwards to a JSP page. Which threejsp:useBean attributes must be used to access this attribute in the JSP page?()
A

id

B

name

C

bean

D

type

E

scope

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

第1题:

Which statement is true about web container session management?()

  • A、Access to session-scoped attributes is guaranteed to be thread-safe by the web container.
  • B、To activate URL rewriting, the developer must use the HttpServletResponse.setURLRewriting method.
  • C、If the web application uses HTTPS, then the web container may use the data on the HTTPS request stream to identify the client.
  • D、The JSESSIONID cookie is stored permanently on the client so that a user may return to the web application and the web container will rejoin that session.

正确答案:C

第2题:

Upon a user’s first visit to the website, which two operations are always performed when the getSession method is called with no arguments in a servlet?()

  • A、 All URLs returned by the server are rewritten.
  • B、 An HttpSession object is created if necessary.
  • C、 The user name and password of the user are checked.
  • D、 The session ID is stored in the HTTP response as a cookie.

正确答案:B,D

第3题:

WhichtwoclassesorinterfacesprovideagetSessionmethod?()

A.javax.servlet.http.HttpServletRequest

B.javax.servlet.http.HttpSessionContext

C.javax.servlet.http.HttpsServletResponse

D.javax.servlet.http.HttpSessionBindingEvent

E.javax.servlet.http.HttpSessionAttributeEvent


参考答案:A, D

第4题:

For which three events can web application event listeners be registered?()

  • A、When a session is created
  • B、After a servlet is destroyed
  • C、When a session has timed out
  • D、When a cookie has been created
  • E、When a servlet has forwarded a request
  • F、When a session attribute value is changed

正确答案:A,C,F

第5题:

A session-scoped attribute is stored by a servlet, and then that servlet forwards to a JSP page. Which threejsp:useBean attributes must be used to access this attribute in the JSP page?()

  • A、id
  • B、name
  • C、bean
  • D、type
  • E、scope

正确答案:A,D,E

第6题:

Which two prevent a servlet from handling requests.?()

  • A、 The servlet’s init method returns a non-zero status.
  • B、 The servlet’s init method throws a Servlet Exception
  • C、 The servlet’s init method sets the Servlet Response’s context length to 0
  • D、 The servlet’s init method sets the Servlet Response’s content type to null.
  • E、 The servlet’s init method does NOT return within a time period defined by the servlet container.

正确答案:B,E

第7题:

Which interface must a session attribute implement if it needs to be notified when a web container persistsa session?()

  • A、javax.servlet.http.HttpSessionListener
  • B、javax.servlet.http.HttpSessionBindingListener
  • C、javax.servlet.http.HttpSessionAttributeListener
  • D、javax.servlet.http.HttpSessionActivationListener

正确答案:D

第8题:

Whichinterfacemustaclassimplementtobeinformedofasessioncreationevent?()

A.javax.servlet.http.HttpSessionListener

B.javax.servlet.http.HttpSessionBindingListener

C.javax.servlet.http.HttpSessionCreationListener

D.javax.servlet.http.HttpSessionActivationListener


参考答案:A

第9题:

You have a use case in your web application that adds several session-scoped attributes. At the end of theuse case, one of these objects, the manager attribute, is removed and then it needs to decide which of theother session-scoped attributes to remove. How can this goal be accomplished?()

  • A、The object of the manager attribute should implement the HttpSessionBindingListener and it should call the removeAttribute method on the appropriate session attributes.
  • B、The object of the manager attribute should implement the HttpSessionListener and it should call the removeAttribute method on the appropriate session attributes.
  • C、The object of the manager attribute should implement the HttpSessionBindingListener and it should call the deleteAttribute method on the appropriate session attributes.
  • D、The object of the manager attribute should implement the HttpSessionListener and it should call the deleteAttribute method on the appropriate session attributes.

正确答案:A

第10题:

Given the HttpServlet code:   getServletContext().setAttribute(“foo”, “value”); What is the result?()

  • A、 The attribute foo is placed in the application
  • B、 A ServletContextListener registered for that servlet is notified
  • C、 A ServletAttributeListener registered for that servlet is notified
  • D、 An HttpSessionAttributeListener registered for that servlet is notified

正确答案:A

更多相关问题