• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 4
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic