Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Communication between browsers

 
david allen
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check this page ..
http://www.webreference.com/javascript/970106/
HTH
 
Rubal Sidhu
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic