This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Servlets and the fly likes How to close a child window through the servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "How to close a child window through the servlet?" Watch "How to close a child window through the servlet?" New topic
Author

How to close a child window through the servlet?

jespher vhaugn
Greenhorn

Joined: Sep 26, 2003
Posts: 4
Hi All,
Does anybody have done closing a window through the servlet? I'm only using Java and servlets in manipulating a form(created separately and viewed through the browser). No javascript.

Here's the scenario: by clicking a link from the parent window, another window opens displaying a form. By clicking a button from the form, the newly opened window should be closed and the focus returns to the parent window.
Is there a way to do this?
Hoping for your inputs.
Thanks,
bitoy
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

And you don't use Javascript because...???
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
jespher vhaugn
Greenhorn

Joined: Sep 26, 2003
Posts: 4
we're not allowed to use javascript because there is already a predefined form to be manipulated...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

we're not allowed to use javascript because there is already a predefined form to be manipulated...

That makes no sense to me, but the point is, there are just some things that require Javascript to accomplish. If you won't or can't or don't use Javascript, then you just can't do those things.
Servlets and JSPs are server-side technologies. HTML and Javascript are client-side. To perform client-side operations, you need to use client-side tools.
Maybe we can discuss why you, or your boss, or your client, or whoever, thinks that you can't safely use Javascript because of some 'predefined form' issue?
hth,
bear
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9046
    
  10
How about this?

servlet #1 calls servlet #2 which contains the html of the form. When you click the button (submit (with info) or cancel (with no info) the form) you are clicking a link back to the first servlet


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
jespher vhaugn
Greenhorn

Joined: Sep 26, 2003
Posts: 4
Suppose I can use javascript in closing the child window,
how will I do it if the command would come from the form displayed in the child window...
 
GeeCON Prague 2014
 
subject: How to close a child window through the servlet?