Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Servlet forwarding in new window

Posted on 2006-10-27
5
Medium Priority
?
495 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 1000 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 1000 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

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 …
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

877 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