Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Launch a servlet from a JSP

Status
Not open for further replies.

pondi

Programmer
Jun 6, 2001
32
GB
Hello all!
I'm using a servlet that creates a PDF file and then opens it.

1)On my main JSP page, I've associated a button click with a link to my servlet, it worked well, the PDF file appeared in the active window.

2)I want now That PDf appears in a secund window, so i've associated the button click to a creation of window and I'm trying to launch the servlet from the new window, here is my code:
_________________________________
<title>PDF</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;application/pdf&quot;>

<SCRIPT LANGUAGE=&quot;JAVASCRIPT&quot;>
function doSubmit(path)
{
window.location.href= path;
}

</script>
</head>

<body onLoad=&quot;doSubmit('<%= Constantes.pathServlet %> PDFServlet')&quot; >

</body>
</html>
______________________________________

Doing this, the servlet is called, file created on application server but the PDF does not appear. Actually, it opens a window asking me if I want to download or open my servlet (as if it was a file!!).

Any help??
Tell me if I'm on the wrong forum too...

Alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top