题目内容

考虑下面的HTML页面代码:请求,当用户在显示的超链接上单击时将调用HelloServlet的哪个方法?( )

A. doPost()
B. doGet()
C. doForm()
D. doHref()

查看答案
更多问题

若需要向浏览器发送Microsoft Word文档,应使用下面哪条语句创建out对象?( )

A. PrintWrite out=response.getServletOutput();
B. PrintWrite out=response.getWrite();
C. OutputStream out=response.getWriter();
D. OutputStream out=response.getOutputStream();

对于名为helloweb的Web应用程序,的定义为/helloServlet/hello/abc.jsp,那么测试页面abc.jsp用的URL为( )

A. http://localhost:8080/helloweb/helloServlet/hello/abc.jsp
B. http://localhost:8080/helloweb/abc.jsp
C. http://localhost:8080/helloweb/helloServlet/abc.jsp
D. http://localhost:8080/helloweb/hello/abc.jsp

假设在myServlet应用中有一个MyServlet类,在web.xml文件中对其进行如下配置: mysrvlet com.wgh.MyServlet < servlet-mapping> myservlet /welcome 则以下选项可以访问到MyServlet的是()。

A. http://localhost:8080/MyServlet
B. http://localhost:8080/myservlet
C. http://localhost:8080/com/wgh/MyServlet
D. http://localhost:8080/welcome

JSP文件在第一次运行的时候被JSP引擎编译为()文件。

A. Servlet
B. Class
C. HTML
D. XML

答案查题题库