File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Communication between browsers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Communication between browsers" Watch "Communication between browsers" New topic
Author

Communication between browsers

david allen
Ranch Hand

Joined: Sep 27, 2002
Posts: 185
I have a page call main.jsp and it has a link to a page called addUser.jsp - I wish addUser.jsp to pop up on top of main.jsp. And when the user has entered their data in addUser.jsp I want it to close and redirect main.jsp to their new account page.
How do I open a new JSP page on top of an existing one?
And how does the new page redirect the old page?
Please can someone help as the boss is waiting on this one!!!
Do I need to use javaScript
Thank you so much
David
bharat nagpal
Ranch Hand

Joined: Oct 26, 2002
Posts: 76
you can use javascript window.open() method to open the new browser window and with this open() method, you can modify your new browser window as per your requirements I mean to say if you don't want to include status bar, address bar etc.
and on closing of this window you can call some javascript method in the main.jsp and in that method you can write the code to redirect.you will find code for help on net.
david allen
Ranch Hand

Joined: Sep 27, 2002
Posts: 185
Ok using the java script to open a new window how do i then place a form on it ie. input fields, submit buttons?
Thank you
david
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5371
check this page ..
http://www.webreference.com/javascript/970106/
HTH


"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
Rubal Sidhu
Greenhorn

Joined: Aug 24, 2002
Posts: 14
David
Here is you solution
1.In main.jsp specify the target in <form> say tmain
2.On submitting main.jsp use javascript.open() function & mention target="new/child" to open adduser.jsp in new window.
3.Submit adduser.jsp to main.jsp provided the target here is tmain.
4.In main.jsp include your code that if some request is coming from adduser.jsp,redirect it to someotherpage.jsp else display main.jsp
Pseudocode for main.jsp
if(request.getparameter("addusername")!=null)
response.redirect("someotherpage.jsp")
else
//show main.jsp
I hope it will work
njoi
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"Sidhu",
Your name does not comply to the Javaranch naming policy. You can find it here. Your display names needs to be two words, you firstname, a space, then your last name. Accounts with invalid display names get deleted.
You can edit your account here
Thanks,
Dave.
[ July 11, 2003: Message edited by: David O'Meara ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Communication between browsers