Passing client browser info to JSF via javascript

I wanted to get the clients browser info and screen resolution and pass in into to a contact form so I can tell a little bit about the client’s browser encase of unreproducible issues. Basically run a javascript function to collect the info from it’s implicit objects and write that to a hidden form element.

Had this working in JSP ok, and with a slight tweak to account for the : in the hidden field id (fromname:compnonentId) it works.
In JSF file…

function getClientInfo()
{
var clientinfo = “”
clientinfo+=”Browser:” + navigator.appName + “,”
var b_version=navigator.appVersion
clientinfo+=” Version: ” + b_version + “,”
clientinfo+=” Screensize: ” + screen.width +”x” + screen.height
(document.getElementById(’contactfrm:clientinfo’)).value = clientinfo;
}


‹h:form id=”contactfrm” styleClass=”form”>

In Backingbean the usual code to get a request param:

String clientInfo = getFacesContext().getExternalContext().getRequestParameterMap().get(”contactfrm:clientinfo”);

Or is there a better way of doing this? comments most welcome