单选题Given: 10.public void service(ServletRequest request, 11.ServletResponse response) { 12.ServletInputStream sis = 13.// insert code here 14.} Which retrieves the binary input stream on line 13?()Arequest.getWriter();Brequest.getReader();Crequest.getInputStream();Drequest.getResourceAsStream();

单选题
Given: 10.public void service(ServletRequest request, 11.ServletResponse response) { 12.ServletInputStream sis = 13.// insert code here 14.} Which retrieves the binary input stream on line 13?()
A

request.getWriter();

B

request.getReader();

C

request.getInputStream();

D

request.getResourceAsStream();


参考解析

解析: 暂无解析

相关考题:

In this hotel, special room service is available () request.A、AtB、InC、UponD、above

Given:10.publicvoidservice(ServletRequestrequest,11.ServletResponseresponse){12.ServletInputStreamsis=13.//insertcodehere14.}Whichretrievesthebinaryinputstreamonline13?() A.request.getWriter();B.request.getReader();C.request.getInputStream();D.request.getResourceAsStream();

Servlet的基本架构public class ServletName extends HttpServlet {public void doPost(HttpServletRequest request, HttpServletResponse response) throwsServletException, IOException {}public void doGet(HttpServletRequest request, HttpServletResponse response) throwsServletException, IOException {}}1、用String的方法将数据类型转换为String。

Given a Filter class definition with this method: 21.public void doFilter(ServletRequest request, 22.ServletResponse response, 23.FilterChain chain) 24.throws ServletException, IOException { 25.// insert code here 26.} Which should you insert at line 25 to properly invoke the next filter in the chain, or the target servlet if thereare no more filters?()A、chain.forward(request, response);B、chain.doFilter(request, response);C、request.forward(request, response);D、request.doFilter(request, response);

Given a JSP error page, which implicit object refers to the uncaught Throwable that resulted in th epage being invoked?()A、 ErrorB、 ExceptionC、 ThrowableD、 Request errorE、 Request exception

Given a header in an HTTP request:X-Retries:4 Which two retrieve the value of the header from a given HttpServletRequest request?()A、Request.getHeader("X-Retries")B、Request.getIntHeader("X-Retries")C、Request.getRequestHeader("X-Retries")D、Request.getHeaders("X-Retries").get(0)E、Request.getRequestHeaders("X-Retries").get(0)

下面有关Servlet中service()方法说法不正确的是()A、在init()方法正确执行完成后,service()将被容器调用B、容器调用service()方法来处理客户端的请求C、service()中有用于接受客户端请求信息的ServletResponse对象和用户对客户端进行相的ServletRequest对象D、Servlet对象通过ServletRequest获取客户端的相关信息和请求信息

InitialNASmessage包括()A、Attach RequestB、Tracking Area Update RequestC、Authentication RequsetD、Service RequestE、Detach Request

以下()属于DTAP信令. A、PagingB、SetupC、CM SERVICE ACCEPTD、CLASSMARK REQUEST

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 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"))

Given: 10.public void service(ServletRequest request, 11.ServletResponse response) { 12.ServletInputStream sis = 13.// insert code here 14.} Which retrieves the binary input stream on line 13?()A、request.getWriter();B、request.getReader();C、request.getInputStream();D、request.getResourceAsStream();

Given an HttpSession session,a ServletRequest request,and a ServletContext context,which retrieves aURL to /WEB-INF/myconfig.xml within a web application?()A、session.getResource("/WEB-INF/myconfig.xml")B、request.getResource("/WEB-INF/myconfig.xml")C、context.getResource("/WEB-INF/myconfig.xml")D、getClass().getResource("/WEB-INF/myconfig.xml")

Which retrieves all cookies sent in a given HttpSErvletRequest request?()A、 request.getCookies()B、 request.getAttributes()C、 request.getSession ().getCookies()D、 request.getSession (). GetAttributes()

Given a header in an HTTP request: X-Retries:4  Which two retrieve the value of the header from a given ServletRequest request? ()A、 request.getHeader (“X-Retries”)B、 request.getIntHeader (“X-Retries”)C、 request.getRequestHeader (“x-Retries”)D、 request.getHeaders (“X-Retries”).get (0)E、 re request.getRequest Headers (“X-Retries”). Get (0)

单选题Given an HttpSession session,a ServletRequest request,and a ServletContext context,which retrieves aURL to /WEB-INF/myconfig.xml within a web application?()Asession.getResource(/WEB-INF/myconfig.xml)Brequest.getResource(/WEB-INF/myconfig.xml)Ccontext.getResource(/WEB-INF/myconfig.xml)DgetClass().getResource(/WEB-INF/myconfig.xml)

单选题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);

单选题Which retrieves all cookies sent in a given HttpSErvletRequest request?()A request.getCookies()B request.getAttributes()C request.getSession ().getCookies()D request.getSession (). GetAttributes()

单选题Given a JSP error page, which implicit object refers to the uncaught Throwable that resulted in th epage being invoked?()A ErrorB ExceptionC ThrowableD Request errorE Request exception

单选题下面有关Servlet中service()方法说法不正确的是()A在init()方法正确执行完成后,service()将被容器调用B容器调用service()方法来处理客户端的请求Cservice()中有用于接受客户端请求信息的ServletResponse对象和用户对客户端进行相的ServletRequest对象DServlet对象通过ServletRequest获取客户端的相关信息和请求信息

单选题Given: 10.public void service(ServletRequest request, 11.ServletResponse response) { 12.ServletInputStream sis = 13.// insert code here 14.} Which retrieves the binary input stream on line 13?()Arequest.getWriter();Brequest.getReader();Crequest.getInputStream();Drequest.getResourceAsStream();

多选题Given a header in an HTTP request: X-Retries:4  Which two retrieve the value of the header from a given ServletRequest request? ()Arequest.getHeader (“X-Retries”)Brequest.getIntHeader (“X-Retries”)Crequest.getRequestHeader (“x-Retries”)Drequest.getHeaders (“X-Retries”).get (0)Ere request.getRequest Headers (“X-Retries”). Get (0)

单选题Given a Filter class definition with this method: 21.public void doFilter(ServletRequest request, 22.ServletResponse response, 23.FilterChain chain) 24.throws ServletException, IOException { 25.// insert code here26. } Which should you insert at line 25 to properly invoke the next filter in the chain,or the target servlet if thereare no more filters?()Achain.forward(request, response);Bchain.doFilter(request, response);Crequest.forward(request, response);Drequest.doFilter(request, response);

单选题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: 22.String id = request.getParameter("jsessionid"); 23.// insert code here 24.String name = (String) session.getAttribute("name"); Which three can be placed at line 23 to retrieve anexisting HttpSession object?()AHttpSession session = request.getSession();BHttpSession session = request.getSession(id);CHttpSession session = request.getSession(true);DHttpSession session = request.getSession(false);EHttpSession session = request.getSession(jsessionid);

单选题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.

单选题You work as an application developer at Certkiller .com. You have been given the task of developing a Windows service application that regularly monitors other Windows services on the same computer. This Windows service application must also log any abnormal file system activity. You have added the following class to the Windows service application: public class EnumerateService : ServiceBase { public static EnumerateService () { this.ServiceName = "Enumerate Service"; this.CanStop = true; } protected override void OnStart (string[] args) { // Enumerate all services and initialize the FileSystemWatcher } protected override void OnStop () { // Stop the FileSystemWatcher and perform cleanup } public static void Main () { EnumerateService service = new EnumerateService(); } } You then create the installer for the Windows service application, and install the Windows service application. You have configured the Windows service Startup type to Automatic, and rebooted the system. You then test the new Windows service application, and find that it is not working.You need to ensure that the service is working properly. What should you do?()A Override the OnBoot method instead of the OnStart method.B Replace the Main method code with the following code: EnumerateService service = new EnumerateService (); Service.Run ();C Override the OnLoad method instead of the OnStart method.D Replace the Main method code with the following code: EnumerateService service = new EnumerateService (); Run (service);

多选题Given: Which four code fragments, inserted independently at line 7, will compile?()Apublic void m1() { }Bprotected void m1() { }Cprivate void m1() { }Dvoid m2() { }Epublic void m2() { }Fprotected void m2() { }