| Author |
want to open response.sendRedirect in a new window
|
Prasenjit Das
Greenhorn
Joined: Aug 12, 2003
Posts: 10
|
|
hi folks, i am using this line in my code response.sendRedirect("http://www.google.com/search?q="+str_search+" + Maharashtra + India"); this works, I want to open this in a new window. so i tried like this - response.sendRedirect("%><script language="javascript">window.open("http://www.google.com/search?q="<%=str_search%>" + Maharashtra + India")</script><%"); but this is giving me the following errors : Error(29,33): illegal character Error(29,33): unclosed character literal Error(29,158): unclosed character literal Error: malformed expression I am not being able to correct. Can anybody help me regarding this. Thanks a lot in advance. regards, Prasen
|
 |
Navin Thr
Greenhorn
Joined: Nov 08, 2002
Posts: 2
|
|
just make a few changes to your view. try putting in the target attribute if it is a form submit action, <form method="post" action="someAction" target="_blank"> if it is a link, <a href="someAction?key=value" target="_blank">Click here</a> Regards, Navin
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56202
|
|
|
As Navin indicated, you must target the original request to the window in which you want the response to appear. Once the request has been made, there is no way to change the window in which its response will be displayed.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Prasenjit Das
Greenhorn
Joined: Aug 12, 2003
Posts: 10
|
|
GREAT GUYS!!! IT WORKS!!! So, is it like a mantra- that whenever u want to open the request.sendRedirect in a new window put in the target attribute inside the form tag. Thanks a lot, Cheers.
|
 |
 |
|
|
subject: want to open response.sendRedirect in a new window
|
|
|