Solved

store screen resolution values in a variable

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If your vDisk VHD file gets deleted from the image store accidentally or on purpose, you won't be able to remove the vDisk from the PVS console. There is a known workaround that is solid.
When we talk about DevOps toolchains, I sometimes wonder how many people really get what we’re talking about. I don’t know if it’s just semantics or tone or something else, but sometimes I think it just sounds like buzzword sausage. So it’s always …
A short film showing how OnPage and Connectwise integration works.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

929 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

12 Experts available now in Live!

Get 1:1 Help Now