This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes How can I control the window size in a JSP page? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How can I control the window size in a JSP page?" Watch "How can I control the window size in a JSP page?" New topic
Author

How can I control the window size in a JSP page?

Steven Gao
Greenhorn

Joined: Nov 28, 2002
Posts: 4
In a JSP page, how can I control the window's size or other properties? I mean if I don't use the Javescript function Window.open() in its parent Page, how can I do it in the current page?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

Remember that the only purpose of JSP is to format an HTML page for sending to the client. Anything you can do with HTML/JavaScript you can do in the JSP. Conversely, there's no magic that lets you do things beyond the capabilities built into the browsers.
hth,
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Steven Gao
Greenhorn

Joined: Nov 28, 2002
Posts: 4
Thank you for your answer.
Anyway, I haven't understood it yet. For example, I can use window.open() in javascript to open a new window, and resize it, define its properties. But when I use response.sendRedirect("a.jsp") in a JSP page and jump into the "a.jsp" page. I mean how to code in a.jsp to resize the current window, such as hiding the toolbar, defining the window's height and width, no matter we use javascript or Jsp? Or there is no way to do it?
Rao Kodeboyina
Ranch Hand

Joined: Jun 09, 2002
Posts: 35
You can define the current window height and width by javascript,
window.resizeTo(X,Y); - Adjusts the window size to set X and Y width and height values.


Sun Certified Web Components Developer for J2EE<br />Sun Certified Programmer for Java™ 2 Platform
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

JSP is a server-side technology that merely allows you to easily generate what will be sent to the client side. There is nothing in JSP that will allow you to control anything on the client -- merely to help you format the HTML and JavaScript that will be sent there.
You must use HTML or JavaScript technologies to control your client; e.g. window.open(), window.resizeTo() and so on.
hth,
bear
 
Don't get me started about those stupid light bulbs.
 
subject: How can I control the window size in a JSP page?
 
Similar Threads
printing size
display data when page is shown?
Changing the Print parameters through JSP
setting button size
html:submit button size