Servlet接口中的方法及说明
来源:互联网 发布:python 股票数据库 编辑:程序博客网 时间:2024/05/21 06:12
1、Servlet接口中的方法及说明
public void init(ServletConfig config);
public void service(ServletRequest request,ServletResponse response); //处理客户端请求
public void destroy();
public ServletConfig getServletConfig();
public String getServletInfo();
2、SerlvetConfig接口
public String getInitParameter(String name);
public Enumeration getInitParameterNames();//获得所有初始化参数名的集合
public ServletContext getServletContext();//获取Servlet上下文对象
public String getServletName();//返回Servlet对象的实例名
3、HttpServletRequest接口
public String getContextPath();//返回请求的上下文路径
public Cookie[] getCookies();//返回请求中发送的所有cookie对象,返回值为cookie数组
public String getMethod();//返回请求类型
public String getQueryString();//返回请求中参数的字符串形式,如请求MyServlet?username=mr,则返回username=mr
public String getRequestURI();//返回主机名到请求参数之间的字符串形式
public StringBuffer getRequestURL();//返回请求URL,不包含请求参数。
public String getServletPath();//返回请求URI中的Servlet路径字符串,不包含请求参数
public HttpSession getSession();
4、HttpServletResponse接口
public void addCookie();//向客户端写入cookie
public void sendError(int sc);//发送一个错误状态码为sc的错误响应到客户端
public void sendError(int sc,String msg);//发送包含错误状态码及错误信息的响应到客户端,sc为错误码,msg为错误信息
public void sendRedirect(String location);//使客户端重定向到新的URL
- Servlet接口中的方法及说明
- SERVLET类常用接口及方法
- SERVLET类常用接口及方法
- SERVLET类常用接口及方法
- Servlet方法说明
- Servlet方法说明
- Servlet常用接口、作用域及停止方法
- Servlet接口方法详解
- 【JavaEE】Servlet接口、ServletConfig接口、GenericServlet抽象类、ServletContext接口、HttpServlet类源码及方法
- SQl 注入及jsp+servlet中的应对方法
- Servlet接口的常用方法
- Java中的math类的常用方法及用法说明
- servlet中的init() 方法
- servlet中的配置方法
- Servlet中的doFilter方法
- servlet中的service方法
- servlet中的三个方法
- Servlet中的service方法
- poj2942:Knights of the Round Table(Tarjan)
- 在pc机上移植fatfs文件系统(windows/linux) (一)
- .Net中初步了解ORM框架
- Mysql中一个表的外键是另一个表的主键是否会影响
- OLAP、OLTP的介绍和比较
- Servlet接口中的方法及说明
- 关于蓝牙权限的获取与开启
- 本地电脑与远程服务器之间不能复制粘贴解决方法
- gitlab安装参考
- 在vue中使用scss
- 报错:Crunching Cruncher search_bar_edit_pressed.9.png failed, see logs
- OpenCV SIFT特征点提取算法
- HTML标签语义化
- java add Library