String agent = Request.getheader ("user-agent");
StringTokenizer st = new StringTokenizer (agent, ";");
St.nexttoken ();
Get the user's browser name
String userbrowser = St.nexttoken ();
Get the user's operating system name
String Useros = St.nexttoken ();
You can also get information about this machine:
Operating System Information
System.getproperty ("Os.name"); Win2003 unexpectedly is Win XP?
System.getproperty ("Os.version");
System.getproperty ("Os.arch");
Browser:
Request.getheader ("User-agent") returns the version number, type of the client browser
GetHeader (string name): Gets the header information for the HTTP protocol definition for the delivery file.
Request. GetMethod (): Get the client to the server side of the data transfer method has get, post, put and other types
Request. Getrequesturi (): Gets the client address that issued the request string
Request. Getservletpath (): Gets the file path of the script file requested by the client
Request. getServerName (): Get the name of the server
Request.getserverport (): Get the port number of the server
REQUEST.GETREMOTEADDR (): Obtain the client's IP address
Request.getremotehost (): Get the name of the client computer, if it fails, return the IP address of the client computer
Request.getprotocol ():
Request.getheadernames (): Returns the name of all request headers, and the result set is an instance of a enumeration (enumerated) class
Request.getheaders (string name): Returns all values for the request header of the specified name, and the result set is an instance of a enumeration (enumeration) class