default servlet open-window characteristics

G

Gary N.

Hi -

I want to set the initial browser window opened by a servlet to 'no toolbar'
and 'no menubar' and 'no locationbar'. These items need to be set before
opening a new window.

How do I change the servlet's default open-window options?

Thanks!

Gary
 
W

Wendy S

Gary N. said:
I want to set the initial browser window opened by a servlet to 'no toolbar'
and 'no menubar' and 'no locationbar'. These items need to be set before
opening a new window.
How do I change the servlet's default open-window options?

Those are properties of the client-side browser window, not the Servlet. I
think this is really a JavaScript question, but here's an example from one
of my projects:

<a href="javascript:goPrefs()">Set Profile Preferences</a>
<script>
function goPrefs(){
preferences =
window.open("setProfilePreferences.do","preferences","toolbar=no,resizable=y
es,location=no,directories=no,status=no,menubar=no,height=350,width=475");
preferences.focus();
};
</script>

Note that the target is 'setProfilePreferences.do' which is a Struts
action-- essentially, a Servlet. So the properties of the window get set on
the client side, then the request goes off to the server and the Servlet
responds with the content to display in the window.

Hope that helps clear up what happens where...
 
C

Chris Smith

Gary said:
Hi -

I want to set the initial browser window opened by a servlet to 'no toolbar'
and 'no menubar' and 'no locationbar'. These items need to be set before
opening a new window.

How do I change the servlet's default open-window options?

Servlets simply respond to an HTTP request by sending an HTTP response.
They don't do anything relating to toolbars, menu bars, or location
bars.

The common way to control the appearance of these features on windows in
a web browser is to open the web browser using a JavaScript call to
window.open(...) that specifies the features of the new window. So if
you want to open such a window, you need to arrange for the page that
links *to* the new window to use a JavaScript function with the right
parameters. By the time a servlet is being called to generate the
content for that window, it's already too late.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top