Solved

store screen resolution values in a variable

Posted on 2004-10-19
4
888 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
java beans and EJBs 5 205
servlet init param and contect param 3 72
maven webservice example issue 2 169
maven not picking latest jar instead picking old jar from .m2 12 75
This article describes a serious pitfall that can happen when deleting shapes using VBA.
Invest in your employees with these five simple steps to improve employee engagement and retention.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decadeā€¦

751 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