Solved

Servlet forwarding in new window

Posted on 2006-10-27
5
492 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
[X]
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
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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Unhandled exception type Exception 18 65
ejb on wildfly 5 65
ejb message driven bean mdb creation steps 2 54
junit initializtion error 2 22
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.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

710 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