How do I identify the device (browser) the request is coming from?

Michael Szlapa

To some degree you can find the information about the browser from HTTP request header "User-Agent". For example if the page was called by IE5.5 the header value would be:

Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)

To read it you can do something like this:

request.getHeader("User-Agent");

See also servlet examples coming with the Jakarta-Tomcat.

The bad news is that event if you know the type of the browser you still do not know about some features that user may have had customized: e.g Java may be off, or JavaScript may be off, etc.

Good luck,

Michael

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact