Solved

Servlet forwarding in new window

Posted on 2006-10-27
5
487 Views
Last Modified: 2013-11-24
Hi,
I want that my sevrelt opens a *new* window and forward it to urlChat2
Like this line but this forward to urlChat2 in the *current* window :
getServletContext().getRequestDispatcher(urlChat2).forward(request,response);

And the current window must be forwarded to urlIndex


How can I do this ?

Thank u.
0
Comment
Question by:matthew016
5 Comments
 
LVL 10

Accepted Solution

by:
mbvvsatish earned 250 total points
Comment Utility
servlet can not open a new browser window, since it is a server side program.
you need to do this in the client side itself, by using javascript openwindow.
and use location.replace method to call the servlet from javascript
0
 
LVL 6

Expert Comment

by:valipotor
Comment Utility
use response sendRedirect()
0
 
LVL 9

Author Comment

by:matthew016
Comment Utility
Thank u for this.
However, I don't understand what u say of javascript since i don't know very well this language.
I already tried this in javascript, but I have a problem,
I'll post my problem in the javascript forum in some minutes.
I hope u can help me there !  thanks !
0
 
LVL 9

Author Comment

by:matthew016
Comment Utility
Ah ? so it is possible ?
0
 
LVL 92

Assisted Solution

by:objects
objects earned 250 total points
Comment Utility
specify the target in the link to the servlet

eg.

<a href="MyServlet" target="_new">Click here</a>
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now