• 2022-06-07
    下面选项中,能够获取客户端ip地址的选项是()
    A: <;% HttpServletRequest request=pageContext.getRequest(); String ip = request.getRemoteAddr(); out.println("本机的IP地址为:"+ip);%>;
    B: <;% HttpServletRequest request=(HttpServletRequest)pageContext.getRequest(); String ip = request.getRemoteAddr(); out.println("本机的IP地址为:"+ip);%>;
    C: <;% String ip = request.getRemoteAddr(); out.println("本机的IP地址为:"+ip);%>;
    D: <;% HttpServletRequest request=pageContext.getRequest(); String ip = request.getLocalAddr(); out.println("本机的IP地址为:"+ip);%>;