here's how to get common browsing details like screen height and width, which browser the user is using and what language the browser has, using jsf 1.2 and richfaces 3:
<a4j:commandButton value="#{myBean.getPropertyValue('label.login')}"
action="#{myBean.login}">
<a4j:actionparam name="w" value="screen.width"
assignTo="#{myBean.screenWidth}" noEscape="true" />
<a4j:actionparam name="h" value="screen.height"
assignTo="#{myBean.screenHeight}" noEscape="true" />
<a4j:actionparam name="c" value="navigator.cookieEnabled"
assignTo="#{myBean.cookieEnabled}" noEscape="true" />
<a4j:actionparam name="a" value="navigator.userAgent"
assignTo="#{myBean.userAgent}" noEscape="true" />
<a4j:actionparam name="l" value="navigator.language"
assignTo="#{myBean.browserLanguage}" noEscape="true" />
<a4j:actionparam name="p" value="navigator.platform"
assignTo="#{myBean.platform}" noEscape="true" />
</a4j:commandButton>
No comments:
Post a Comment