Solved

store screen resolution values in a variable

Posted on 2004-10-19
4
883 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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
Exception creating bean of class 5 205
IE doesn't Invoke servlet in iframe 1 115
web application structure 18 103
jsp login check 12 43
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
Ransomware continues to grow in reach and sophistication, putting data everywhere at risk. Learn how to avoid being caught in its sinister clutches with these 11 key tips.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

821 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