Request. get... getHeader information parameter, setrequestheader Parameter
ReprintedBytes
StringTokenizer st = new StringTokenizer (agent ,";");
St. nextToken ();
// Obtain the user's browser name
String userbrowser = st. nextToken ();
System. out. println (userbrowser );
// Obtain the user's OS name
String useros = st. nextToken ();
System. out. println (useros );
// Obtain the information of the local machine as follows:
// Operating system information
System. out. println (System. getProperty ("OS. name"); // win2003 turns out to be winxp?
System. out. println (System. getProperty ("OS. version "));
System. out. println (System. getProperty ("OS. arch "));
// Browser:
System. out. println (request. getHeader ("user-agent "));
// Send another red packet
System. out. println (request. getHeader ("user-agent"); // return the version and type of the client browser.
System. out. println (request. getMethod (); // The methods used to obtain data transmitted from the client to the server include get, post, and put.
System. out. println (request. getRequestURI (); // obtain the client address that sends the request string
System. out. println (request. getServletPath (); // obtain the file path of the script file requested by the client
System. out. println (request. getServerName (); //: Obtain the server name.
System. out. println (request. getServerPort (); //: Obtain the server port number.
System. out. println (request. getRemoteAddr (); //: Obtain the Client IP address.
System. out. println (request. getRemoteHost (); //: Obtain the name of the client computer. If the name fails, the IP address of the client computer is returned.
System. out. println (request. getProtocol ());//:
System. out. println (request. getHeaderNames (); //: returns the names of all requestheaders. The result set is an instance of the enumeration (enumeration) class.
System. out. println ("Session Id:" + request. getRequestedSessionId ());
System. out. println ("Content Length:" + request. getContentLength ());
System. out. println ("Remote User:" + request. getRemoteUser ());
System. out. println ("Request URI:" + request. getRequestURI ());
System. out. println ("Host:" + request. getHeader ("Host "));
System. out. println ("Connection:" + request. getHeader ("Connection "));
System. out. println ("Cookie:" + request. getHeader ("Cookie "));
System. out. println ("Created:" + session. getCreationTime ());