码迷,mamicode.com
首页 > 其他好文 > 详细

获取客户端信息

时间:2017-10-07 18:43:24      阅读:114      评论:0      收藏:0      [点我收藏+]

标签:tco   host   head   个数   ddr   value   服务器端   客户端   表单提交   

input.jsp

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<body>
<form action="showInfo.jsp" method="post">
数据1:<input type="text" name="shuju1"><br>
数据2:<input type="text" name="shuju2"><br>
<input type="submit" value="提交">
</form>
</body>

showInfo.jsp

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<body>
<font color="blue">表单提交信息:</font><br>
输入的第一个数据是:<%=request.getParameter("shuju1") %><br>
输入的第二个数据是:<%=request.getParameter("shuju2") %><br>
<font color="red">客户端信息:</font><br>
客户端协议名和版本名:<%=request.getProtocol() %><br>
客户机名:<%=request.getRemoteHost() %><br>
客户机的IP地址:<%=request.getRemoteAddr() %><br>
客户提交信息的长度:<%=request.getContentLength() %><br>
客户提交信息的方式:<%=request.getMethod() %><br>
HTTP头文件中Host值:<%=request.getHeader("Host") %><br>
服务器名:<%=request.getServerName() %><br>
服务器端口名:<%=request.getServerPort() %><br>
接受客户提交信息的页面:<%=request.getServletPath() %><br>
</body>

获取客户端信息

标签:tco   host   head   个数   ddr   value   服务器端   客户端   表单提交   

原文地址:http://www.cnblogs.com/ljs-666/p/7635156.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!