• Servlet


    Servlet是运行在Web服务器端的java应用程序,它用java语言编写,具有java语言的优点。与普通的java程序区别是,servlet对象具有对http请求处理的功能,并且其运行需要web容器的支持。

    Servlet常用API(更多方法及声明请查阅java ee API)

    servlet接口

    public void service(ServletRequest request,ServletResponse response)

    public void destroy()

    public ServletConfig getServletConfig()

    public String getServletInfo()

    HttpServlet类

    protected void doGet(HttpServletRequest req,HttpServletResponse res)

    protected void doPost(HttpServletRequest req,HttpServletResponse res)

    protected void doPut(HttpServletRequest req,HttpServletResponse res)

    HttpServletResquest类

    public String getContextPath()

    public Cookie[] getCookies()

    public String getQueryString()

    public String getRequestURI()

    public Httpsession getsession()

    HttpServletResponse类

    public void addCookie(Cookie cookie)

    public void sendError(int sc)

    public void sendError(int sc,String msg)

    public void sendRedirect(String location)

    Servlet配置解析

    创建了Servlet类后,还需要对其进行配置,目的是将其注册到Servlet容器中,以方便容器对其的调用

    过滤器的创建与配置

  • 相关阅读:
    MySQL Delete 后,如何快速释放磁盘空间
    浅谈MySQl 主从复制
    MySQL 5.6,5.7 基于Shell 的一键安装
    【MySQL 5.7 】从库1032 报错处理
    633. Sum of Square Numbers
    find a balance point in an array
    Longest Common Prefix
    cubic root
    41. First Missing Positive
    build tree with balanced parenthesis
  • 原文地址:https://www.cnblogs.com/blmdlm/p/3702897.html
Copyright © 2020-2023  润新知