4、如果是整个应用程序共享的数据,则适合放在( )中成为属性。
A. ServletConfig
B. ServletContext
C. ServletRequest
D. Session
5、HttpServlet定义在( )之中。
A. javax.servlet
B. java.http
C. javax.servlet.http
D. javax.http
6、在web.xml中预先对Servlet进行初始化设置的代码如下:myWordhello则以下获取初始化参数的语句中正确的是( )。
A. StringmyWord=getInit("myWorld");
B. StringmyWord=getInit("myWord");
C. StringmyWord=getInitParameter("hello");
D. StringmyWord=getInitParameter("myWord");
7、在Servlet中,HttpServletResponse的( )方法用来把一个HTTP请求重定向到另外的URL。
A. sendURL
B. redirectURL()
C. sendRedirect()
D. redirectResponse()