首页 > 其他 > 详细

获取客户端信息

时间:2017-10-07 18:20:22      阅读:272      评论:0      收藏:0      [点我收藏+]

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>

获取客户端信息

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!