Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Servlet forwarding in new window

Posted on 2006-10-27
5
490 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
ID: 17818942
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
ID: 17818950
use response sendRedirect()
0
 
LVL 9

Author Comment

by:matthew016
ID: 17818982
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
ID: 17818985
Ah ? so it is possible ?
0
 
LVL 92

Assisted Solution

by:objects
objects earned 250 total points
ID: 17824231
specify the target in the link to the servlet

eg.

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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
diffSum example 4 50
SHA2 certs for IIS AND Java? 2 113
maven disable workspace resolution 1 16
Setup GlassFish 4 21
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

809 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