Actually,the flow goes like:
Report.jsp :
<Html:form .. action="/viewReport ... target=_blank" > target is blank
because I want Excel to open in new window...
It maps the /viewReport from strutsConfig to reach an Action class.
<action path="/viewReport" type="com.hcl.sme.action.ViewReportAction"
name="ViewReportForm" input="/pages/report.jsp" scope="request">
In action I have:
return actionMapping.findForward("success");
It maps this from struts config again :
<forward contextRelative="true" name="success" path="/Report"
redirect="false" />
Now it maps this /Report from web.xml ,where it reaches the servlet and
opens the Excel.
The problem is if one Excel is already open.it gives an error msg saying:
anpther instance of /viewReport.do is already open. /viewReport is the
action of form..
As you mention I am setting the filename as repsonse header in my servlet:
response.setContentType("application/vnd.ms-excel");
strReportPath =(String) request.getAttribute("strReportPath");
response.setHeader("Content-disposition","filename=" + strReportPath );
But to no avail.
----------------------------------------------------------------------------
-----------------------------DISCLAIMER-------------------------------------
----------------------------------------------------------------------------
---------
This message and any attachment(s) contained here are information that is
confidential, proprietary to HCL Technologies and its customers. Contents
may be privileged or otherwise protected by law. The information is solely
intended for the individual or the entity it is addressed to. If you are not
the intended recipient of this message, you are not authorized to read,
forward, print, retain, copy or disseminate this message or any part of it.
If you have received this e-mail in error, please notify the sender
immediately by return e-mail and delete it from your computer.
-----Original Message-----
From: Wendy Smoak [mailto:[EMAIL PROTECTED]
Sent: Friday, March 18, 2005 9:16 AM
To: Struts Users Mailing List
Subject: Re: [OT] Displaying XL in browser
From: "Mili Aggarwal, Noida" <[EMAIL PROTECTED]>
> Yah,I tried that but IE creates major problem..It ognores that header..Can
> someone help me soon as its really urgent!!
I also use this:
res.setHeader("Content-disposition", "filename="+browserFilename);
and it works just fine in IE. They happen to be .csv files, but most of my
users have .csv associated with Excel. And they can open more than one, so
I don't believe that IE is ignoring the header.
--
Wendy Smoak
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Disclaimer:
This message and any attachment(s) contained here are information that is
confidential,proprietary to HCL Technologies and its customers, privileged
or otherwise protected by law.The information is solely intended for the
individual or the entity it is addressed to. If you are not the intended
recipient of this message, you are not authorized to read, forward,
print,retain, copy or disseminate this message or any part of it. If you
have received this e-mail in error, please notify the sender immediately by
return e-mail and delete it from your computer.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]