Solved

store screen resolution values in a variable

Posted on 2004-10-19
4
871 Views
Last Modified: 2008-03-17
How can I store the screen reolution ie the height and width in jsp (java) variables.
Thanks
0
Comment
Question by:monitorscreen
  • 2
4 Comments
 
LVL 13

Assisted Solution

by:petmagdy
petmagdy earned 75 total points
ID: 12352968
Ok this is the solution, I assume u read the screen resolution using some client side script, if ur jsp called for example mypage.jsp, call in ur first web page that for example called index.jsp the client script used to read the screen resolution and then submit those values to an action or servlet as URL get or post parameters, and let that action or servlet store the values into the session so that be accessable to any page u want like mypage.jsp



0
 
LVL 2

Accepted Solution

by:
siliconeagle earned 125 total points
ID: 12356085
make a sniffer page with code similar to the following:-
<html>
<script>
function sniff() {
var hgt=window.screen.availHeight;
var wid=window.screen.availWidth;
document.location="<your_JSPor_servlet>?wid="+wid+"&hgt="+hgt;
}
</script>
<body onload="sniff()">
...
</body>
</html>
then get the parameters wid & hgt from your JSP using request.getParameter().
0
 
LVL 2

Expert Comment

by:siliconeagle
ID: 12481676
did this help? havent heard anything in a while.
0
 

Author Comment

by:monitorscreen
ID: 13044501
Sorry about the delay, that did work, thanks very much :)
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now