• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Communication between browsers

 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 5397
1
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
check this page ..
http://www.webreference.com/javascript/970106/
HTH
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic