Problem with Exporting Data to Word



I am facing the following problem while exporting data to Word.

The current implementation is as described below:
I have a JSP file which has a link that enables you to export the data
to
Word.
Clicking on the link invokes a javascript function:
function showRTF() {
var newWin = window.open("",
"newWin","width=900,height=800%,scrollbars=yes,menubar=yes,resizable=yes,too
lbar=yes,location=no");
window.document.formShowRTF.target="newWin";
window.document.formShowRTF.submit();
}

and submits the form:
<form name="formShowRTF" method="POST"
action="http://<IP>/SampleApplication/servlet/mypackage.ExportServlet">
<input type="hidden" name="RTFData" value="<%=strTemp%>" >

Now submiting the form (POST operation)....invokes the Servlet which
performs the export of the data.
The data is passed as a hidden form parameter.

The ExportServlet immplementation is as follows:

public void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException,
IOException
{
response.setContentType("application/msword");
ServletOutputStream os =
response.getOutputStream();

String strTemp = request.getParameter("RTFData");

if (strTemp==null)
{
strTemp = "No Data";
}

os.write(strTemp.getBytes());
}


Now let me explain the problem area:

Exporting the data to word for the very first time, opens a popup
window
having an inline word document.
Data gets exported to the word document within the popup window.
Now, if i keep the popup window containing the data open, and i again
request an export operation,
i.e. i again click on the export to word link, this time the pop up
window
is not refreshed with the new data requested!!
Whats happening surprisingly is, instead of calling the doPost() method
of
the Servlet, the doGet() method
is invoked the second time when you request an export operation, with
the
popup window open.
This is quite strange!!

I have also tried opening different windows for every request.
The problem with this approach is that the first window hangs or
becomes
blank.
The first window displays the data, but its the earlier data and not
the new
requested data.
The reason i guess is again same:
the doGet() method is invoked the second time an export request is
made,
instead of doPost().
Also, no data is fetched in the doGet() method.

Another alternative is opening different Word docs for every request
instead
of an inline doc.
However, I would like to know if there is a way to refresh the contents
of
the inline document using JScript that is already open within a browser
window?

Regards,
Mukta

.



Relevant Pages

  • Re: New browser window
    ... > I am exporting a report to .PDF. ... (My real problem is the window with which I am viewing ... file....Just open a popup window via Javascript pointing at the url of ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Need help with the conversation of cdr to jpg
    ... the exact settings will depend a bit on the ... open at the bottom of the window. ... RGB before exporting. ... Unless your logo has very small details, ...
    (comp.graphics.apps.corel)
  • MOSAIC: little bug (invalid requests)
    ... the request sent to the server is invalid. ... you get his profile/contact info in a new window. ... reproduce the problem, I have to open perhaps 5 or 6 windows before it ... And I have seen this happen on many different web sites over ...
    (comp.os.vms)
  • Re: BASIC authentication Issues with IE - Part II - Solved but WHY?
    ... REQUEST and RESPONSE logging below to show you whats going on. ... using my local machine web server. ... However, at this point I am logged in and I have lots of links, one is a "who is online" link client?who.wcn, which I will open this up in a second window. ...
    (microsoft.public.inetserver.iis.security)
  • Re: Whats Up With USPS Delivery Confirmation?
    ... If you print your label thru PP it may or may not - to be sure take it ... to a window and make sure they scan it - they ARE NOT REQUIRED to - ... You can request package pickup (if you have at least one ...
    (alt.marketing.online.ebay)