• 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

open another window

 
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hallo and merry Christmas!
I have the following question.
My servlet sends a *.html file opening up at the clients screen. I want to include a 'hint' button which opens a NEW window. With Javascript, if enabled would be very easy, but I would like to do this by a servlet.
Thus the idea: the button gets the name 'HINT' and is a submit-button calling a servlet but this servlet should open up another window, such that the old-one does not vanish.
At this moment I solved this problem by a href and target=top , but I am curious about a servelet-solution ...
Thanks if you know and let us know
Peter
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are confusing your technologies. A Servlet is a server-side process, opening a new browser window is a client-side process. The closest a Servlet can get is to send back HTML + DHTML that opens the new window. However, it is an important distinction to recognize that the servlet itself is not opening the window.
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chris is right. A servlet cannot do this, since the client's browser itself controls whether another a link appears in a new window.
The best you can do is to use Javascript.
 
Peter Gragert
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks ...
I just wanted to not use Javascript ...
So the a href= ... target=top is the only viable solution.
Thanks for your clarifying answers.
Peter
 
Whose rules are you playing by? This tiny ad doesn't respect those rules:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic