在项目中建立一个JavaBean 该类为:bean.Student,给bean具有name属性,则下面标签用法正确的是:
A.
B. hello student!
C. hello student!
D.
查看答案
在JSP中想要使用JavaBean:mypackage.mybean,则以下写法正确的是:
A.
B.
C.
D.
当用户点击超链接向Servlet发出请求时,调用的Servlet中的哪个方法?
A. doPost()
B. doPut()
C. init()
D. doGet()
用户自定义Servlet需要继承自下列哪个类?
A. HttpServletRequest
B. HpptServletResponse
C. Servlet
D. HttpServlet
给定如下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. 错误信息