File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Steven Gao
Greenhorn
Posts: 4
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Steven Gao
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic