Hi,
I need to get user-agent header to check what type of browser is used. With command:
request.getHeader("User-Agent")
I got not whole information. For example the result is:
Mozilla/4.0 (Mac OS X 10.5.4) Java/1.5.0_13,
when it shoud look like:
Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-GB; rv:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16
Using:
Enumeration headerNames = request.getHeaderNames();
for(Enumeration<String> e = request.getHeaderNames() ;headerNames.hasMoreElements();){
StringBuffer buff = new StringBuffer();
String next = e.nextElement();
for(Enumeration<String> ee = request.getHeaders(next); ee.hasMoreElements();){
buff.append(ee.nextElement());
buff.append(" ");
}
System.out.println(next + "\t" + new String(buff));
}
I think I checked everything what I can get from request headers... I got this:
content-type application/octet-stream
cache-control no-cache
pragma no-cache
user-agent Mozilla/4.0 (Mac OS X 10.5.4) Java/1.5.0_13
host localhost:8080
accept text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
connection keep-alive
content-length 262
So is there any way to get whole information about user-agent?? I can do this at servlet and in applet.