协议和路径信息

来源:互联网 发布:怎么隐藏域名信息 编辑:程序博客网 时间:2024/06/05 03:28

协议和路径信息

通信协议:HTTP/1.1
URL请求中使用协议:http
响应请求的服务器端文件路径:/jsptech/getproUrl.jsp
脚本文件相对路径:/jsptech/getproUrl.jsp
脚本文件物理:C:/Program Files/Apache Software Foundation/Tomcat 6.0/webapps/ROOT/jsptech/getproUrl.jsp 

<!--getproUrl.jsp-->
<
%@page contentType="text/html;charset=gb2312" language="java"%>
<html>
<head>
<title>协议和路径信息</title>
</head>
<body>
<a href="getproUrl.jsp">协议和路径信息</a><br><br>
通信协议:<%=request.getProtocol()%><br>
URL请求中使用协议:<%=request.getScheme()%>
<br>响应请求的服务器端文件路径:<%=request.getRequestURI()%><br>
脚本文件相对路径:<%=request.getServletPath()%><br>
脚本文件物理:<%=request.getRealPath(request.getServletPath())%>
</body>
</html>