• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What browser am I in?

 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Can an applet find out what browser it is running in?
2. Can it find out which version of the plugin it is using?
3. Can an applet, without going to java.net packages, find out information abou the web server that served it up?

System properties you can query include java.vendor, java.version, os.arch and os.name. Are there any tricks to find out what version of the plugin you're using, or would that just be java.version?

Also, can an applet find out anything about the HttpServer it was served up by? With a Servlet I can read headers, but an Applet can't read any headers without creating a URL or Http object, correct?

Just polishing up on my applets.

Cheers!
 
Manuel Moons
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. One way of finding out what browser you are running in is calling a javascript method which returns the browser type. There might be other ways but that's one way that I'm sure of that should work. So in short, yes an applet can find out the type of browser!

2. Via System.getProperty("java.version") you should be able to read the plugin version. Isn't that sufficient?

3. That depends! If the webserver wrote some settings in the applets parameters (html page) it could read those ... But I don't know if that is sufficient for you?
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
awesome, dude...That's exactly what I was fishing for.

Cheers!

-Cameron
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic