File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javascript in jsp

 
Pradeep Baisani
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic