reproduced
StringTokenizer st = new StringTokenizer (agent, ";");
St.nexttoken ();
Get the user's browser name
String Userbrowser = St.nexttoken ();
System.out.println (Userbrowser);
Get the user's operating system name
String Useros =st.nexttoken ();
System.out.println (Useros);
This information can also be obtained from this machine:
Operating System Information
System.out.println (System.getproperty ("Os.name")); Win2003 unexpectedly is WinXP?
System.out.println (System.getproperty ("os.version"));
System.out.println (System.getproperty ("Os.arch"));
Browser:
System.out.println (Request.getheader ("user-agent"));
and send a red envelope.
System.out.println (Request.getheader ("user-agent"));//Returns the version number, type of the client browser
System.out.println (Request.getmethod ());//: Get, post, put, etc. for client to send data to server side
System.out.println (Request.getrequesturi ());//: Obtain the client address of the issuing request string
System.out.println (Request.getservletpath ());//: Get the file path of the script file requested by the client
System.out.println (Request.getservername ()); : Get the name of the server
System.out.println (Request.getserverport ()); : Gets the port number of the server
System.out.println (Request.getremoteaddr ()); : Obtain the IP address of the client
System.out.println (Request.getremotehost ());//: Gets the name of the client computer and, if it fails, returns the IP address of the client computer
System.out.println (Request.getprotocol ()); :
System.out.println (Request.getheadernames ()); : Returns the name of all Requestheader, the result set is an instance of a enumeration (enum) 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 ());
Request.get. GetHeader information parameters that can be obtained