Paul Taylor
Oct 5th, 2005, 10:29 AM
I have a jsp which when you click on a button calls some javascript which uses the window.open method to call a spring controller which then called a subclass of AbstractPdfView to creates a pdf and displays it to screen.
On Firefox browser it works fine but not on IE6, it does not work it brings up an empty window with a 'Cannot Find Server' message. Even though IE fails the controller is correctly called and the PDFDocument built but I think something is wrong with the renderMergedOutputModel() (which is final and hence cant be overridden)
If I change the javascript so that it calls window.location and hence displays the pdf in the main window rather than a popup window it works fine on Firefox and IE, but this is no good to me I need it to open in a new window.
I need to use javascript rather than just usinag a href="url" target="_blank" because I need to determine which report the user has selected for displaying from a list.
relevent parts of jsp
function viewaspdf()
{
var selectedId = getSelectedEntityIdString('listTable');
window.open('http://localhost:9080${pageContext.request.contextPath}/exportreport.do?viewaspdf=' + selectId);
}
<a href="javascript:viewaspdf()" <img src="images/icons/i_pdf.gif"/>PDF</a>
any help appreciated paul
On Firefox browser it works fine but not on IE6, it does not work it brings up an empty window with a 'Cannot Find Server' message. Even though IE fails the controller is correctly called and the PDFDocument built but I think something is wrong with the renderMergedOutputModel() (which is final and hence cant be overridden)
If I change the javascript so that it calls window.location and hence displays the pdf in the main window rather than a popup window it works fine on Firefox and IE, but this is no good to me I need it to open in a new window.
I need to use javascript rather than just usinag a href="url" target="_blank" because I need to determine which report the user has selected for displaying from a list.
relevent parts of jsp
function viewaspdf()
{
var selectedId = getSelectedEntityIdString('listTable');
window.open('http://localhost:9080${pageContext.request.contextPath}/exportreport.do?viewaspdf=' + selectId);
}
<a href="javascript:viewaspdf()" <img src="images/icons/i_pdf.gif"/>PDF</a>
any help appreciated paul