Javeed Akthar wrote:
> Hi,
>
> i would like to know whether there is any way of finding out the name of
> the browser and the os from which a servlet is invoked.
>
> the http header user agent returns a string in the form
>
> Browser Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)
>
> Is there any way other than parsing the above string in order to get the
> name of the browser ? and how do we get the name of the operating system
> under which the above browser is running ? the length and contents of
> the above string varies for different browsers and operating systems.
> hence parsing for the os name does not seem to yield consistent
> results.
>
> Thanks in advance.
>
> Regards,
>
> Javed
>
Yes, you're going to have to do some parsing to recognize that this is really
Internet Explorer 4.01 on Windows NT.
JavaScript coders have this issue all the time, because they have to deal with
the differences between HTML support in the various browsers. I would suggest
looking at some of the JavaScript archive sites for a browser recognition
script, and then port the code to a Java class.
Craig McClanahan
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html