• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get client;s screen resolution ?

 
omkar patkar
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

Can you please help me to know the screen resolution of client's browser on server side ? i am using Struts 1.2.8, jsp 1.2 and servlet 2.3 specification. Please let me know. I have found ways using javascript, but wihtout using javacript, ...can the client's browser info be obtained from the http request header ?

Million thanks in advance
Omkar Patkar.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Browsers don't send screen resolution in the HTTP request headers.
If your Javascript method is working, your best bet is probably to stick with it.

Knowing the client's resolution in a browser based app (as opposed to a WAP client, which does send the resolution in the HTTP headers) has limited value anyway. You have no way of knowing what size the browser window is on the user's desktop anyway. You also don't know how many toolbars they've got in their browser at any given time.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!