getRemoteUserpublic java.lang.String getRemoteUser()
Returns the name of the user making this request, if the user has logged in using HTTP authentication. This method returns null if the user login is not authenticated. Whether the user name is sent with each subsequent request depends on the browser. Same as the value of the CGI variable REMOTE_USER.
Returns:
a String specifying the name of the user making this request, or null
Returns the name of the user making this request, if the user has logged in using HTTP authentication. This method returns null if the user login is not authenticated. Whether the user name is sent with each subsequent request depends on the browser. Same as the value of the CGI variable REMOTE_USER.
Returns:
a String specifying the name of the user making this request, or null
解决方案 »
- 请问怎么把单选框的值加起来得到总分
- 为什么我的ms sqlserver2005需要sqljdbc4的包
- 做过OJ(Online Judge)或者正在做 的人 请进 大家一起讨论讨论(或者认为自己有能力做的人)
- 中文乱码问题!!在线等
- 求网页表格插件,要求能流畅显示大量数据(大约5000条)
- 清空session后,怎样使后退按钮定向?
- 如何安装两个jdk,指定resin使用其中的一个?
- 请问这是什么原因?
- 请教<META HTTP-EQUIV=Refresh CONTENT=\"60; URL=nodeb_power_display.wso\">相关问题
- 新手求教:我们为什么使用jsp页面而不是html呢?
- 关于JSP的,各位大虾进来看看,急,在线等待
- drop-down box in jsp
Internet Explorer/工具/Internet选项/连接/局域网设置/代理服务器/
勾选"对于本地地址不使用代理服务器"一项/高级/在例外处加上你自己的IP,或访问你同局域网的机器可将其机器加入.
试一试!!
import javax.servlet.*;
import javax.servlet.http.*;public class RequestInfo extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<body>");
out.println("<head>");
out.println("<title>Request Information Example</title>");
out.println("</head>");
out.println("<body>");
out.println("<h3>Request Information Example</h3>");
out.println("Method: " + request.getMethod());
out.println("Request URI: " + request.getRequestURI());
out.println("Protocol: " + request.getProtocol());
out.println("PathInfo: " + request.getPathInfo());
out.println("Remote Address: " + request.getRemoteAddr());
out.println("</body>");
out.println("</html>");
} /**
* We are going to perform the same operations for POST requests
* as for GET methods, so this method just sends the request to
* the doGet method.
*/ public void doPost(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
doGet(request, response);
}
}
您可以试试: http://member.isavvix.com/wukw/index.jsp
显示的三个值依次是:request.getRemoteHost()、request.getRemoteAddr()、request.getRemoteUser()
我这里前两个显示结果都是202.106.103.190(局域网出口,而不是本地IP)
我这里显示:62.30.0.2
62.30.0.2
null
但是我的实际地址是:
213.48.241.30
为什么??我也想知道
这是必然的。
我也是通过局域网代理出去的,怎么是正常的,
是不是你本机没设置IP地址!还是其它的问题!
不知道是怎么一回来呀
String ServerUrl=request.getRemoteAddr();
String abc=request.getRemoteUser();
String ac=request.getRemoteHost();