• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

how to open a form in separate window?

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using the following code in the servlet to open a form. I want to open this form in a separate window(like a dialog box window). Can somebody help me how can I do that from servlet. Thanks.


This is the code in servlet:



RequestDispatcher view = request
.getRequestDispatcher("feedbackForm.jsp");
view.forward(request, response);

 
Marshal
Posts: 67478
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't do that from the servlet. You'll have to handle it on the client prior to invoking the servlet.
 
Ranch Hand
Posts: 212
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
- You can use "target " attribute of anchor and specify "_blank" as value to open the URL in new window. OR
- Use a javascript dialog box, there are lot's of around, try jquery modal dialog box.
 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,You can use window.open() function of javascript.like this-

function open() {
var load = window.open('name of servlet or JSP you want to open','','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no');
}

Modify parameters according to your requirements.

You can call this function from your HTML part in output stream.
 
reply
    Bookmark Topic Watch Topic
  • New Topic