Servlet 访问路径配置、B/S 架构流程、HTTP 请求对象及参数获取

36. 在访问 Servlet 时,在浏览器地址栏中输入的路径是在 ( ) 地方配置的【单选】

A. <servlet-name/> B. <servlet-mapping/>

C. <uri-pattern/> D. <url-pattern/>

答案:D. <url-pattern/>

37. 对于 B/S 架构的工作流程,以下说法正确的是 ( )【单选】

A. 浏览器接受用户的输入-->浏览器向服务器端发送请求-->服务器端数据处理-->响应数据至客户端 B. 发送响应-->浏览器接受用户的输入-->浏览器向服务器端发送请求-->服务器端数据处理

C. 发送响应-->浏览器接受用户的输入-->服务器端数据处理-->浏览器向服务器端发送请求 D. 浏览器接受用户的输入-->发送响应-->服务器端数据处理-->浏览器向服务器端发送请求

答案:A. 浏览器接受用户的输入-->浏览器向服务器端发送请求-->服务器端数据处理-->响应数据至客户端

38. 在 Web 容器(tomcat)中,以下哪个类别的实例代表 HTTP 请求对象?( )【单选】

哪种类型的对象 A. HttpRequest B. HttpServletRequest C. HttpServletResponse D. HttpPrintWriter

答案:B. HttpServletRequest

39. 哪个程序代码可以取得 password 请求参数的值?( )【单选】

A. request.getParameter('password'); B. request.getValues('password')[0]; C. request.getParameterValues('password')[0]; D. request.getRequestParameter('password');

答案:A. request.getParameter('password');

40. 以下的空格应该填入哪个方法?( )【单选】

response.setContentType('text/html;charset=UTF-8');
PrintWriter out = response.____________;
out.println('hello world');
...

A. getPrintWriter() B. getWriter() C. getBufferedWriter() D. getOutputWriter()

答案:B. getWriter()


原文地址: http://www.cveoy.top/t/topic/o2JW 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录