wood burning stoves 2.0*
The moose likes Servlets and the fly likes URGENT-->New Window from Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "URGENT-->New Window from Servlet" Watch "URGENT-->New Window from Servlet" New topic
Author

URGENT-->New Window from Servlet

Mayank Chaturvedi
Greenhorn

Joined: Oct 01, 2001
Posts: 4
I am calling a servlet from the Login Page . It does some check . If the check fails , I want a new window to open displaying the Error else if the check passes , the next page is loaded in the same window as the Login . In this case , no new window has to be opened .
Can someone tell me how we can open a new window from a servlet ?
anand chawla
Ranch Hand

Joined: Oct 19, 2000
Posts: 91
Well its simple
use javascript this way
<%
if(request.getParameter("login")==null)
{
%>
<script>
window.open("error.html");
</script>
<% }
%>
Mayank Chaturvedi
Greenhorn

Joined: Oct 01, 2001
Posts: 4
Thanks for ur reply.
But , my problem is that I want to open the new window from the servlet code itself . So , I cannot use javascript there . So is there any code in Java from which I can open a new window ?
Mahajan Bhupendra
Ranch Hand

Joined: Dec 01, 2000
Posts: 118
i couldn't undrestand ur problem..
can't u use like this..
out.println("<script>window.open('location')</script>");
???
Bhupendra


<B>Bhupendra Mahajan</B>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: URGENT-->New Window from Servlet
 
Similar Threads
session issue with multi tabs in a browser
New window from request dispatcher
Open an XML file in a popup window
Can I use RequestDispatcher to open a new browser window
Closing all open windows and opening new one