网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
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
考题
J2EE中以下关于HttpServlet的说法错误的是()A、 HttpServlet是一个抽象类B、 HttpServlet类扩展了GenericServlet类C、 HttpServlet类的子类必须至少重写service方法D、 HttpServlet位于javax.servlet.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自身的资源
考题
编写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?()A
response.setError(302);B
response.sendError(302);C
response.setStatus(302);D
response.sendRedirect(302);E
response.sendErrorRedirect(302);
考题
单选题在J2EE中,对于HttpServlet类的描述,错误的是()。A
我们自己编写的Servlet继承了HttpServlet类,一定需覆盖doPost或者doGetB
Httpservlet类扩展了GenericServlet类,实现了GenericServlet类的抽象方法C
Httpservlet类中处理客户请求和响应时所使用的两个接口是:HttpServletRequest和HttpServletResponseD
我们自己编写的servlet继承了Httpservlet类,一般只需要覆盖doPost或doGet方法,不必覆盖servive()方法,因为一个service()方法会调用doPost或者doGet方法
考题
单选题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?()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.
热门标签
最新试卷