博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
20160324 javaweb 之request
阅读量:7012 次
发布时间:2019-06-28

本文共 1134 字,大约阅读时间需要 3 分钟。

package com.dzq.servlet;import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.annotation.WebServlet;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;@WebServlet("/CustomInfoServlet")public class CustomInfoServlet extends HttpServlet {	private static final long serialVersionUID = 1L;		protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {		String url=request.getRequestURL().toString();		System.out.println(url);		String uri=request.getRequestURI().toString();		System.out.println(uri);		String qStr=request.getQueryString();		System.out.println(qStr);		String ip=request.getRemoteAddr();		System.out.println(ip);		String method =request.getMethod();		System.out.println(method);		String name=request.getContextPath();		System.out.println(name);	}		protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {		doGet(request, response);	}}

  

 

  

转载于:https://www.cnblogs.com/xiaoduc-org/p/5317546.html

你可能感兴趣的文章
Task类使用总结
查看>>
防表单重复提交
查看>>
个人网站优化的出路和方向
查看>>
dhcp的基本配置命令
查看>>
myeclipse添加数据库连接
查看>>
我的友情链接
查看>>
Oracle数据库创建与安装_超越OCP精通Oracle视频教程培训02~04
查看>>
Windows 8 X64 RTM 英文版 9200.16384 正版下载
查看>>
Hyper-V File Server 文件共享服务器
查看>>
WordPress内外网访问的问题解决
查看>>
在linux上安装redis
查看>>
奔跑吧,SOC(一)——软件是怎么控制硬件的
查看>>
初学vim编辑器必会常用功能
查看>>
HttpSession之学习笔记
查看>>
我的友情链接
查看>>
centos: 建立git账户
查看>>
Maven|项目命令
查看>>
python filter, map, 和reduce
查看>>
memcached 异常 : 单数据项超过默认值1m
查看>>
mysql创建登录报错ERROR1045(28000)
查看>>