Servlet forwarding in new window

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.
LVL 9
matthew016Asked:
Who is Participating?
 
mbvvsatishConnect With a Mentor Commented:
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
 
valipotorCommented:
use response sendRedirect()
0
 
matthew016Author Commented:
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
 
matthew016Author Commented:
Ah ? so it is possible ?
0
 
objectsConnect With a Mentor Commented:
specify the target in the link to the servlet

eg.

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

From novice to tech pro — start learning today.