2

What's the best way to get client screen attributes to my backing bean? I'd like to work out some dynamic sizing and popup positioning. The application is built with ICEfaces/JSF2.0.

I'm thinking of having a javascript function assigning the client attributes to the value attribute of a hidden input and then grabbing it from there, but I was hoping for something less cumbersome.

Any ideas?

TheDream34
  • 73
  • 1
  • 2
  • 5
  • 1
    Using JS is the only way to do it, the browser doesn't send these information with a request. – Adam Feb 11 '11 at 23:10
  • http://stackoverflow.com/questions/5727925/dynamically-setting-width-and-heigt-according-to-client-screen-resulotion-in-jfr – Shan Arshad Feb 20 '14 at 08:16
  • Check out the link. http://stackoverflow.com/questions/5727925/dynamically-setting-width-and-heigt-according-to-client-screen-resulotion-in-jfr – Shan Arshad Feb 20 '14 at 08:17

2 Answers2

0

You may have to use filters to determine the screen size and redirect to the specific url to display

Kwesi Aryee
  • 310
  • 2
  • 15
-1

I solved this myself by writing a Java Servlet and a JavaScript function that obtains the window size and makes a HTTP request to pass this information to the servlet. Both the servlet and JSF Managed Beans have access to the HTTP Session ID so I know which web client the HTTP request has come from.

Simon C
  • 1,977
  • 11
  • 14
  • 12
    can you post the code for javascript/xhtml/ and backing bean? Really interested to see how this is done. I've been trying hard myself to figure this out with JSF – Jason H Nov 25 '11 at 22:29
  • Would be a good idea if you share your code – AngelAvila Dec 21 '22 at 16:22