I am doing this in a servlet (handler)only. Also this works fine, if I direct the request directly to this handler. If the request is a window.location.reload(true), then only the issue happens.
Currently from the submit jsp(J1)(where user selects the select report), it goes to the handler(H1), where it gets the report from SAS.So if the report type is pdf or excel, we forward to temporary jsp, which has the scripts added and run and onload of this page the reload() is called for the same handler(H1)(to avoid the back url issue). In the handler, I see if the req has any hidden value set, if set, it is directed to report displaying handler(H2) that has the code given in the previous reply.
So I dont get it why does it displays it as text.
If I directly forward the req on submit(J1) to H2, the report is displayed as pdf . So is it because it is like a refresh.
Can we do something that the browser comes to know it is pdf