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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

dynamically link back into existing browser window?

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I have a unique request and I'm not sure if it's possible. I'm working on a simple web app (just JSP's and Servlets). The requirements ask for dynamic links in the application page that open content in a new browser window or tab. No problem there.

Well, now they're asking for dynamic links in this new browser page that will change the content in the original window and take the browser's focus back to that window or tab. Can this be done? Is there a way to maintain the session state of that first browser window and somehow allow the servlet to pass control back to that browser window and change its content via url args?

I'm sure there's a better approach to solving this requirement but I'm afraid there's not enough time to change the entire architecture or adopt something like AJAX.

Thanks!
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
The child window has access to its parent via the opener variable.

(It amazes me how people think that Ajax is the solution to just about everything).
 
Shawn Kuenzler
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Thanks, Bear!

Now I'm trying to do the reverse. Allowing the user to return to the parent window and click on links that update the child window (rather than opening successive new windows).

Having the same target name in the anchor tag looks to be the easiest way to do this but it's not working in conjunction with a servlet mapping.

This works:


This doesn't work. These links will open a new window everytime


What is it about the servlet URL mapping that causes the links to not return to the child window?

Thanks!
Shawn
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
allof the targets have different values hence they will target different windows.

Eric
 
Shawn Kuenzler
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I know. That was only for sake of having different examples. If you click on any one of those links -- multiple times -- it'll open its target (with the same name...) in a new window each time.
 
Shawn Kuenzler
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Anyone?
 
    Bookmark Topic Watch Topic
  • New Topic