• 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:
  • 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

Starting browsers not in same session

 
Ranch Hand
Posts: 1970
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is sort-of Java, sort-of Web stuff and sort-of General Computing. But here it is in the Web tech forum...

I have a Java server application with a Web user interface. The customer insisted that the Java server application start-up should fire up a Web browser to display the user interface on the machine that is running the server. I used "rundll32 url.dll,FileProtocolHandler" on Windows and com.apple.eio.FileManager.openURL() on Mac OS X to achieve this.

Although lacking control (there are no parameters apart from URL), this has been reasonably successful until now. Now the server application has two Web user interfaces. These are both supposed to fire up when the Java server application starts.

The methods described above are perfectly capable of starting two, or more, Web browsers. Unfortunately, they usually all seem to end up in the same HTTP session. This is a bit of a disaster, as they tread all over each other's session data.

Any ideas how I might avoid this problem? Ideally, a way to start up multiple browsers and be sure they are in separate HTTP sessions.

Note that I already tried using java.awt.Desktop from Java 6. Behaves the same as my existing code. It probably works the same inside...
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you open the two browsers manually in a tradional manner, do you run into the same problem?

Maybe implement a cookieless session? [stab in the dark]

Eric
[ August 08, 2007: Message edited by: Eric Pascarello ]
 
Peter Chase
Ranch Hand
Posts: 1970
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When the browsers are opened separately "manually", there is no problem. You get two separate sessions and both applications work fine.

Your comment about cookies is interesting. I wonder whether it may explain why some browsers have the problem and some don't. Sounds like something for me to investigate.
 
Peter Chase
Ranch Hand
Posts: 1970
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems that completely disabling cookies does fix the problem, in FireFox and Internet Explorer.

I would prefer if we didn't require users to go changing their Web browser configuration. Is there a way to tell Java (Servlets?) never to use cookies, even when they are available in the browser?

My application uses Jetty 4 Web server, embedded - if this matters.
 
Peter Chase
Ranch Hand
Posts: 1970
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, Jetty has such a switch. So the problem, which seemed intractable, is in fact fixed with just a single line change.

Thanks, Eric!
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am guessing my wild idea worked...lol

Eric
 
I child proofed my house but they still get in. Distract them with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic