在servlet中,可以通过request对象获取客户端的哪些信息?
这题是有选项的(多选)A、客户端IP地址B、客户端网卡MAC地址C、客户端浏览器表单form中填写的数据D、客户端cookies信息...
这题是有选项的(多选)
A、客户端IP地址
B、客户端网卡MAC地址
C、客户端浏览器表单form 中填写的数据
D、客户端cookies信息 展开
A、客户端IP地址
B、客户端网卡MAC地址
C、客户端浏览器表单form 中填写的数据
D、客户端cookies信息 展开
7个回答
展开全部
Method Summary java.lang.StringgetAuthType()
Returns the name of the authentication scheme used to protect the servlet. java.lang.StringgetContextPath()
Returns the portion of the request URI that indicates the context of the request. Cookie[]getCookies()
Returns an array containing all of the Cookie objects the client sent with this request. longgetDateHeader(java.lang.String name)
Returns the value of the specified request header as a long value that represents a Date object. java.lang.StringgetHeader(java.lang.String name)
Returns the value of the specified request header as a String. java.util.EnumerationgetHeaderNames()
Returns an enumeration of all the header names this request contains. java.util.EnumerationgetHeaders(java.lang.String name)
Returns all the values of the specified request header as an Enumeration of String objects. intgetIntHeader(java.lang.String name)
Returns the value of the specified request header as an int. java.lang.StringgetMethod()
Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT. java.lang.StringgetPathInfo()
Returns any extra path information associated with the URL the client sent when it made this request. java.lang.StringgetPathTranslated()
Returns any extra path information after the servlet name but before the query string, and translates it to a real path. java.lang.StringgetQueryString()
Returns the query string that is contained in the request URL after the path. java.lang.StringgetRemoteUser()
Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated. java.lang.StringgetRequestedSessionId()
Returns the session ID specified by the client. java.lang.StringgetRequestURI()
Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request. java.lang.StringBuffergetRequestURL()
Reconstructs the URL the client used to make the request. java.lang.StringgetServletPath()
Returns the part of this request's URL that calls the servlet. HttpSessiongetSession()
Returns the current session associated with this request, or if the request does not have a session, creates one. HttpSessiongetSession(boolean create)
Returns the current HttpSession associated with this request or, if there is no current session and create is true, returns a new session. java.security.PrincipalgetUserPrincipal()
Returns a java.security.Principal object containing the name of the current authenticated user. booleanisRequestedSessionIdFromCookie()
Checks whether the requested session ID came in as a cookie. booleanisRequestedSessionIdFromUrl()
Deprecated. As of Version 2.1 of the Java Servlet API, use isRequestedSessionIdFromURL() instead. booleanisRequestedSessionIdFromURL()
Checks whether the requested session ID came in as part of the request URL. booleanisRequestedSessionIdValid()
Checks whether the requested session ID is still valid. booleanisUserInRole(java.lang.String role)
Returns a boolean indicating whether the authenticated user is included in the specified logical "role".
Returns the name of the authentication scheme used to protect the servlet. java.lang.StringgetContextPath()
Returns the portion of the request URI that indicates the context of the request. Cookie[]getCookies()
Returns an array containing all of the Cookie objects the client sent with this request. longgetDateHeader(java.lang.String name)
Returns the value of the specified request header as a long value that represents a Date object. java.lang.StringgetHeader(java.lang.String name)
Returns the value of the specified request header as a String. java.util.EnumerationgetHeaderNames()
Returns an enumeration of all the header names this request contains. java.util.EnumerationgetHeaders(java.lang.String name)
Returns all the values of the specified request header as an Enumeration of String objects. intgetIntHeader(java.lang.String name)
Returns the value of the specified request header as an int. java.lang.StringgetMethod()
Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT. java.lang.StringgetPathInfo()
Returns any extra path information associated with the URL the client sent when it made this request. java.lang.StringgetPathTranslated()
Returns any extra path information after the servlet name but before the query string, and translates it to a real path. java.lang.StringgetQueryString()
Returns the query string that is contained in the request URL after the path. java.lang.StringgetRemoteUser()
Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated. java.lang.StringgetRequestedSessionId()
Returns the session ID specified by the client. java.lang.StringgetRequestURI()
Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request. java.lang.StringBuffergetRequestURL()
Reconstructs the URL the client used to make the request. java.lang.StringgetServletPath()
Returns the part of this request's URL that calls the servlet. HttpSessiongetSession()
Returns the current session associated with this request, or if the request does not have a session, creates one. HttpSessiongetSession(boolean create)
Returns the current HttpSession associated with this request or, if there is no current session and create is true, returns a new session. java.security.PrincipalgetUserPrincipal()
Returns a java.security.Principal object containing the name of the current authenticated user. booleanisRequestedSessionIdFromCookie()
Checks whether the requested session ID came in as a cookie. booleanisRequestedSessionIdFromUrl()
Deprecated. As of Version 2.1 of the Java Servlet API, use isRequestedSessionIdFromURL() instead. booleanisRequestedSessionIdFromURL()
Checks whether the requested session ID came in as part of the request URL. booleanisRequestedSessionIdValid()
Checks whether the requested session ID is still valid. booleanisUserInRole(java.lang.String role)
Returns a boolean indicating whether the authenticated user is included in the specified logical "role".
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
获取客户端的请求信息,闭袜枣例好大如Form表单中的数据,轿拆可以通过request.getParameter()方法。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
request.getParameter()
(C)升冲念获取表单的所有信判羡息。。
还可以吵困获取(A)客户端IP地址。(D)客户端cookies信息
(C)升冲念获取表单的所有信判羡息。。
还可以吵困获取(A)客户端IP地址。(D)客户端cookies信息
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询