• 20160324 javaweb 之request


    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);
    	}
    
    }
    

      

      

  • 相关阅读:
    微信小程序 列表渲染 wx:for
    微信小程序获取数据、处理数据、绑定数据关键步骤记录
    jq获取页面距离
    jq中哪个方法有回调函数
    轮播图jq版
    计算器
    计算机基础
    安装LAMP
    ubuntu安装最新版本的node.js
    blade模版之页面的嵌套
  • 原文地址:https://www.cnblogs.com/xiaoduc-org/p/5317546.html
Copyright © 2020-2023  润新知