zoukankan      html  css  js  c++  java
  • 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之force index和ignore index
    Linux中CPU性能分析工具perf简单使用(亲测可用)
    Linux之SeLinux
    Docker基础
    yum常用命令
    MySQL总结
    MySQL字符集详解
    MySQL5.6的4个自带库详解
    Python操作MySQL
    MySQL索引原理
  • 原文地址:https://www.cnblogs.com/blmdlm/p/3702897.html
Copyright © 2011-2022 走看看