Given an HttpServletRequest request, which retrieves an object of type Account with an Id of “account”?()A、 Account account = request.get Resource(”account”):B、 Account account = request.get Attribute (“account”):C、 Account account = request.get Parameter (account”):D、 Account account = (Account)request.getResource (“account”):E、 Account account = (Account) request.get Attribute (“account”):F、 Account account = (Account) request.get Paramter (“account”):

Given an HttpServletRequest request, which retrieves an object of type Account with an Id of “account”?()

  • A、 Account account = request.get Resource(”account”):
  • B、 Account account = request.get Attribute (“account”):
  • C、 Account account = request.get Parameter (account”):
  • D、 Account account = (Account)request.getResource (“account”):
  • E、 Account account = (Account) request.get Attribute (“account”):
  • F、 Account account = (Account) request.get Paramter (“account”):

相关考题:

在J2EE中,对于HttpServlet类的描述,正确的是()。 A.我们自己编写的Servlet继承了HttpServlet类,一般只需覆盖doPost或者doGet方法,不必覆盖service()方法。因为一个service()方法是空的B.HttpServlet类扩展了GenericServlet类,实现了GenericServlet类的抽象方法service()C.HttpServlet类有两个service()方法D.我们自己编写的Servlet继承了HttpServlet类,一般只需覆盖doPost或者doGet方法,不必覆盖service()方法。因为一个service()方法会调用doPost或者doGet方法

在J2EE中,以下关于HttpServlet说法错误的是( )A、HttpServlet是一个抽象类B、HttpServlet扩展了GenericServlet类C、HttpServlet类的子类必须至少重写service方法D、HttpServlet位于javax.servlet.http包中

____ a lift in your car, I would not have been home. A、Had you not given meB、I had not givenC、You had not given meD、Had I not given

Servlet中,使用()接口中定义的()方法来处理客户端发出的表单数据请求。A、HttpServlet,doPostB、ServletRequest,doGetC、ServletRequest,doPostD、HttpServlet,doHead

Given: String value = getServletContext().getInitParameter("foo"); in an HttpServlet and a web applicationdeployment descriptor that contains: foo frodo Which two are true?()A、The foo initialization parameter CANNOT be set programmatically.B、Compilation fails because getInitParameter returns type Object.C、The foo initialization parameter is NOT a servlet initialization parameter.D、Compilation fails because ServletContext does NOT have a getInitParameter method.E、The foo parameter must be defined within the  element of the deployment descriptor.

Why does IS-IS use the SPF algorithm?()A、to determine the pseudonode IDB、to determine the next hop to a given destinationC、to determine the complete path to a given destinationD、to determine the number of routers present in a given area

自定义的servlet应重载Httpservlet类的()方法以响应客户发出的post 请求方法。A、PostB、OnpostC、doPostD、Responspost

HttpServlet类中定义了Servlet对象必须实现()。A、Stop()B、Init()C、Service()D、Destroy()

HttpServlet类中定义了Servlet对象必须实现的init(),Service(),destroy()等方法。()

J2EE中以下关于HttpServlet的说法错误的是()A、 HttpServlet是一个抽象类B、 HttpServlet类扩展了GenericServlet类C、 HttpServlet类的子类必须至少重写service方法D、 HttpServlet位于javax.servlet.http包中

HttpServlet是定义在()套件之中。A、javax.servletB、javax.servlet.httpC、java.httpD、javax.http

在J2EE中,对于HttpServlet类的描述,错误的是()。A、我们自己编写的Servlet继承了HttpServlet类,一定需覆盖doPost或者doGetB、Httpservlet类扩展了GenericServlet类,实现了GenericServlet类的抽象方法C、Httpservlet类中处理客户请求和响应时所使用的两个接口是:HttpServletRequest和HttpServletResponseD、我们自己编写的servlet继承了Httpservlet类,一般只需要覆盖doPost或doGet方法,不必覆盖servive()方法,因为一个service()方法会调用doPost或者doGet方法

下列对HttpServlet类描述错误的是()A、HttpServlet类是针对使用Http协议的Web服务器的Servlet类B、HttpServlet类通过执行Servlet借口,能够提供Http协议的功能C、HttpServlet的子类实现了doGet()方法去响应HTTP的Get请求D、HttpServlet的子类实现了doPost()方法去响应HTTP的Post请求E、HttpServlet类通过init()方法和destory()方法管理Servlet自身的资源

JAVA EE中,当把来自客户机的HTTP请求委托给servlet时,会调用HttpServlet的()方法。A、serviceB、doGetC、doPostD、init

下列哪项不是HttpServlet的方法()A、init()B、destroy()C、doPost()D、execute()

编写Servlet的doPost方法时,需要抛出的异常是() A、ServletException,IOExceptionB、ServletException,RemoteExceptionC、HttpServlet Exception,IOExceptionD、HttpServletException,RemoteException

Given the HttpServlet code:   getServletContext().setAttribute(“foo”, “value”); What is the result?()A、 The attribute foo is placed in the applicationB、 A ServletContextListener registered for that servlet is notifiedC、 A ServletAttributeListener registered for that servlet is notifiedD、 An HttpSessionAttributeListener registered for that servlet is notified

多选题在J2EE中,对于HttpServlet类的描述,正确的是()。A我们自己编写的Servlet继承了HttpServlet类,一般只需覆盖doPost或者doGet方法,不必覆盖service()方法。因为一个service()方法是空的BHttpServlet类扩展了GenericServlet类,实现了GenericServlet类的抽象方法service()CHttpServlet类有两个service()方法D我们自己编写的Servlet继承了HttpServlet类,一般只需覆盖doPost或者doGet方法,不必覆盖service()方法。因为一个service()方法会调用doPost或者doGet方法

单选题Given an HttpServlet Request request and Http Servlet Response response, which sets a cookie “username” with the value “joe” in a servlet.?()A request.add Cookie (“username”. “joe”)B request.set Cookie (“username, “joe”)C response.add Cookie (username”, “joe”))D request.add Header (new Cookie (“username”, “joe”))E request.add Cookie (new Cookie (“username”, “joe”))F response.add Cookie (new Cookie (“username”, “joe”))G response.add Header (new Cookie (“username”, “joe”))

单选题Given: 11.public class MyServlet extends HttpServlet { 12.public void service(HttpServletRequest request, 13.HttpServletResponse response) 14.throws ServletException, IOException { 15.// insert code here 16.} 17.} and this element in the web application’s deployment descriptor: 302 /html/error.html Which,inserted at line 15,causes the container to redirect control to the error.html resource?()Aresponse.setError(302);Bresponse.sendError(302);Cresponse.setStatus(302);Dresponse.sendRedirect(302);Eresponse.sendErrorRedirect(302);

单选题在J2EE中,对于HttpServlet类的描述,错误的是()。A我们自己编写的Servlet继承了HttpServlet类,一定需覆盖doPost或者doGetBHttpservlet类扩展了GenericServlet类,实现了GenericServlet类的抽象方法CHttpservlet类中处理客户请求和响应时所使用的两个接口是:HttpServletRequest和HttpServletResponseD我们自己编写的servlet继承了Httpservlet类,一般只需要覆盖doPost或doGet方法,不必覆盖servive()方法,因为一个service()方法会调用doPost或者doGet方法

单选题J2EE中,当把来自客户机的HTTP请求委托给servlet时,会调用HttpServlet的()方法。AserviceBdogetCdopostDinit

判断题HttpServlet类中定义了Servlet对象必须实现的init(),Service(),destroy()等方法。()A对B错

单选题HttpServlet中,用来处理POST请求的方法是()AdoHeadBdoGetCdoPostDdoPut

单选题J2EE中以下关于HttpServlet的说法错误的是()A HttpServlet是一个抽象类B HttpServlet类扩展了GenericServlet类C HttpServlet类的子类必须至少重写service方法D HttpServlet位于javax.servlet.http包中

多选题Given: String value = getServletContext().getInitParameter("foo"); in an HttpServlet and a web applicationdeployment descriptor that contains: foo frodo Which two are true?()AThe foo initialization parameter CANNOT be set programmatically.BCompilation fails because getInitParameter returns type Object.CThe foo initialization parameter is NOT a servlet initialization parameter.DCompilation fails because ServletContext does NOT have a getInitParameter method.EThe foo parameter must be defined within the  element of the deployment descriptor.

单选题Given the HttpServlet code:   getServletContext().setAttribute(“foo”, “value”); What is the result?()A The attribute foo is placed in the applicationB A ServletContextListener registered for that servlet is notifiedC A ServletAttributeListener registered for that servlet is notifiedD An HttpSessionAttributeListener registered for that servlet is notified

单选题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?()AAn IllegalStateException is thrown at runtime.BAn InvalidSessionException is thrown at runtime.CThe string value=null appears in the response stream.DThe string value=myAttributeValue appears in the response stream.