Scenario: The user selects a Reference no and then clicks button in a jsp. After that, a new window should open up and a dynamically generated PDF should be displayed there.
Problem: -- When I run this as a java application, the PDF file is generated fine. But I am new on Struts. and am not sure of the flow for calling and displaying this servlet.
What I have tried to do: -- In the jsp after the user clicks on the button, I pass the following URL while opening another window. eg. var mononeyURL = "http://localhost:9080/pcnavms/monroney.do"; openResourceWindow((mononeyURL) , 600, 800, true, true, true, false);
This opens up the new window fine. And in the monroney jsp, I am trying to intantiate the class eg. monroney.jsp <%@ page language="java" contentType="application/pdf fullscreen=yes"%> <% controller.checkPDF.CreatePOVMonroney al = new controller.checkPDF.CreatePOVMonroney(); al.processRequest(request, response); %>
and in the struts.config file I have declared the following : <global-forwards> <forward name="monroney" path="/WEB-INF/jsp/dlrTnRcv/monroney.jsp" /> </global-forwards>
In order to help you, we need you to be more specific than "doesn't work". Tell us what's happening that shouldn't or what isn't happening that should, including error messages, stack traces, etc. [ August 11, 2006: Message edited by: Merrill Higginson ]
What happens is, it opens up a new window. The File Download Box is displayed.(Save monroney.do) If I click on Save it save a file named monroney.do which has got nothing in it. If I click cancel, then nothing happens. And the new window, anyway disappears.
Joined: Dec 20, 2004
What I am trying here, is generating a PDF file(whose data is dynamically populated) which should be displayed in the new window that has opened (not save it to hard disk).
I can't understand why monroney.do is created as a file and asks for saving it.