RT:System.out.println(req.getRemoteUser());

System.out.println(req.getUserPrincipal());

System.out.println(req.getContentLength());

System.out.println(req.getContentType());

System.out.println(req.getDateHeader(""));

System.out.println(req.getIntHeader("accept"));

System.out.println(req.isUserInRole(""));

解决方案 »

  1.   

    还有这俩:System.out.println(req.getPathTranslated());

    System.out.println(req.getPathInfo());
      

  2.   

    在javaee帮助文档中,HttpServletRequest类里面写的很清楚,除非不认识英文,或者不会用翻译工具
      

  3.   

    request的各种方法,自己看文档去吧。
      

  4.   

    http://jitaguizhao.iteye.com/blog/327286
      

  5.   

    1.
    req.getRemoteUser();Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated. Whether the user name is sent with each subsequent request depends on the browser and type of authentication. Same as the value of the CGI variable REMOTE_USER. Returns:
    a String specifying the login of the user making this request, or null if the user login is not known
    2.req.getContentLength();
    Returns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not known. For HTTP servlets, same as the value of the CGI variable CONTENT_LENGTH. Returns:
    an integer containing the length of the request body or -1 if the length is not known3.req.getDateHeader("");
    Returns the value of the specified request header as a long value that represents a Date object. Use this method with headers that contain dates, such as If-Modified-Since. 
    The date is returned as the number of milliseconds since January 1, 1970 GMT. The header name is case insensitive. If the request did not have a header of the specified name, this method returns -1. If the header can't be converted to a date, the method throws an IllegalArgumentException. 
    Parameters:
    name - a String specifying the name of the header 
    Returns:
    a long value representing the date specified in the header expressed as the number of milliseconds since January 1, 1970 GMT, or -1 if the named header was not included with the request 4.
    req.getPathInfo();Returns any extra path information associated with the URL the client sent when it made this request. The extra path information follows the servlet path but precedes the query string and will start with a "/" character. 
    This method returns null if there was no extra path information. Same as the value of the CGI variable PATH_INFO. 
    5.
    req.getIntHeader("accept"));
    Returns the value of the specified request header as an int. If the request does not have a header of the specified name, this method returns -1. If the header cannot be converted to an integer, this method throws a NumberFormatException. 
    The header name is case insensitive. 
      

  6.   

    不想看api就直接在jsp里打印看效果