File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes javascript in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "javascript in jsp" Watch "javascript in jsp" New topic
Author

javascript in jsp

Pradeep Baisani
Greenhorn

Joined: May 23, 2001
Posts: 2
Hi,
I am trying to open a new page in jsp using response.sendRedirect('url')
As, the url should be opened in a diffrent browser, in jsp I have used some javascript which takes the url and opens in a new browser. But, response.sendRedirect("javascript:windowOpen('url');") is showing an error page.
Would some one suggest me how to open a new page in a new window from jsp.
Thanks,
Deep.
Mark Simms
Ranch Hand

Joined: Jul 20, 2000
Posts: 36
The Javascript only acts if placed within the CALLED url.
In the CALLING JSP:
<%
url = url+"#popup; // indicate a pop-up (new) window is needed
response.sendRedirect(url);
%>
In the CALLED JSP, make sure this code is present:
<script>
if (window.location.hash=="#popup")
window.open(window.location)
</script>


Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javascript in jsp