• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to open a form in separate window?

 
Sam Saha
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);

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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.
 
sudhir nim
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.
 
Ankit Tripathi
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!