zoukankan      html  css  js  c++  java
  • Servlet的三种实现方式

    实现包Servlet的方式

        1.实现Servlet接口

        2.继承GenericServlet类

                  *优化方案:

                          1.对Servlet接口提供适配器的操作

                          2.将getServletConfig方法实现了,复写init()方法时复写无参的

                         3. 实现了ServletConfig方法接口,获取ServletContext对象

                          //获取getServletContext();
                                    ServletContext se = this.getServletConfig().getServletContext();

                           

                           //优化获取
                          ServletContext sc = this.getServletContext();

       3.继承HttpServlet类

                  对Http协议的一种封装

  • 相关阅读:
    kvm virtio
    GPU 线程块/线程束
    ubuntu source
    React
    分布式系统
    honpeyhonepy
    css是干什么的
    bootstrap中的横的列
    数据安全之 alert logic
    viewset的使用的方法
  • 原文地址:https://www.cnblogs.com/joingyb/p/9942621.html
Copyright © 2011-2022 走看看