给定如下Servlet代码:假定在浏览器中输入URL:http://localhost:8080/servlet/HelloServlet,可以调用这个servlet,那么这个Servlet的输出是import java.io.*;import javax.servlet.*;import javax.servlet.http.*;public class HelloServlet extends HttpServlet{public void service(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException{}public void doGet(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException {res.setContentType(""text/html"");PrintWriter out = res.getWriter();out.println("""");out.println("""");out.println(""doGet Hello World!"");out.println("""");out.println("""");out.close();}public void doPost(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException {res.setContentType(""text/html"");PrintWriter out = res.getWriter();out.println("""");out.println("""");out.println(""doPost Hello World!"");out.println("""");}}
A. 一个HTML页面,页面上显示doGet Hello World!
B. 一个HTML页面,页面上显示doPost Hello World!
C. 一个空白的HTML页面
D. 错误信息
在Servlet过滤器的生命周期方法中,每当传递请求或响应时,web容器会调用( )方法。
A. init()
B. service()
C. doFilter()
D. destroy()
当访问一个Servlet时,以下Servlet中的那个方法先被执行?
A. destroy()
B. doGet()
C. service()
D. init()
20.给出了如下的查询条件字符串String condition="insert book values(?,?,?,?,?)"; 下列哪个接口适合执行该 SQL查询( )
A. Statement
B. PrepareStatement
CallableStatement
D. 不确定