下面哪个方法不属于Servlet接口
A: init(ServletConfig config)
B: destroy()
C: getServletInfo()
D: service(ServletRequest req, ServletResponse res)
E: doGet(HttpServletRequest req, HttpServletResponse res)
A: init(ServletConfig config)
B: destroy()
C: getServletInfo()
D: service(ServletRequest req, ServletResponse res)
E: doGet(HttpServletRequest req, HttpServletResponse res)
举一反三
- Filter过滤器中哪个方法在过滤器被销毁时被调用? A: init() B: doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) C: destory() D: init(FilterConfig config)
- 在一个Filter中,处理filter的业务的是()方法 A: dealFilter(ServletRequest reg,ServletResponse res,FilterChain chain) B: dealFilter(ServletRequest reg,ServletResponse res) C: doFilter(ServletRequest reg,ServletResponse res,FilterChain chain) D: doFilter(ServletRequest reg,ServletResponse res)
- 下面Servlet的哪个方法只执行一次,负责对Servlet进行初始化。 A: init B: destroy C: service D: getServletInfo
- LoginServlet是一个Servlet类,代码如下 public class LoginServlet extends ___________ { public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { … } public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { … } } 在下划线处应填写()
- 当访问一个Servlet时,以下Servlet中的哪个方法先被执行( )。 A: service() B: doGet() C: destroy() D: init()