zoukankan      html  css  js  c++  java
  • service方法

    public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException{}

    request参数:封装了请求信息

    (1)request.getParameter(String arg) 获取到form表单提交的参数,当有多个请求值的时候(比如checkbox,多个选择),只会取到一个

    (2)request.getParameters(String arg) 返回一个String类型的数组

    (3)Enumation getParameterNames() 返回参数名对应的Enumation对象

    (4)Map getParametermap()

    (5)HttpServletRequest是ServletRequest的子接口,包含更多获取请求信息的方法

    获取uri,请求方法,servletPath:

    response参数:封装了响应信息

    (1)PrintWriter getWriter() 返回信息,调用print()返回到浏览器。

    (2)response.setContentType("...")设置响应的类型,如word,html,js等

    (3)sendRedirect(String location) 重定向

  • 相关阅读:
    C# 数组
    一个遍历算法
    php csv导出
    linux 配置 crontab
    LINUX 配置SVN
    Linux chkconfig命令
    Linux 安装mysql+apache+php
    linux 安装samba
    linux安装软件的学习
    LINUX中简单的字符命令
  • 原文地址:https://www.cnblogs.com/liqy/p/7823490.html
Copyright © 2011-2022 走看看