This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setting header in websphere 8.

 
pawan chopra
Ranch Hand
Posts: 415
jQuery Mac Objective C
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am sure this problem is very common. I have excel export functionality on my application. I am using Websphere. The export doesn't work on IE8 when on SSL. I searched on internet. I found that WAS sets a header "Cache-Control: no-cache". So because of this IE8 won't allow you to download the excel file. I saw some solutions where people say set header in some servlet filter. But it doesn't work. Then I saw one solution which says as below:

“We finally figured out a hack-ish (but simple) fix to the “no-cache” header
problem…

We found that each instance of a response.addCookie() call causes the
“no-cache…” to be added to the Cache-Control header. So if we just set the
Cache-Control header after all the cookie processing was complete, the
header would then be passed unmolested to the client.

A silly solution to a silly, undocumented problem (feature).”


Looks pretty simple. But I am not sure how do I know that cookie processing is completed? Can any one help me on that?

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33697
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That quote is from the IBM forums. (It's good to cite information so people can read the surrounding context.)

In fact, it says later in that same thread

Indeed, I applied the fix with the CookiesConfigureNoCache=false as specified in the below link and it solved my problem.

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/rrun_chain_httpcustom.html


That seems better to try than hacking at addCookies().
 
Phani Kiran Rudravarapu
Greenhorn
Posts: 3
Android Java MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

We are facing something similar issue. We need to give a progress bar for file downloads and we are thinking of using jquery.download.js
This involves setting response's header with a cookie. When we tested this on our local machine with Tomcat it works fine.
But when we put it on Websphere it doesn't.

We can't try CookiesConfigureNoCache=false setting as getting admin access and modifying this property might be a bureaucratic nightmare.

In the link shared in above posts, i couldn't get what exactly this means "So if we just set the Cache-Control header after all the cookie processing was complete, the header would then be passed unmolested to the client".

Our code to provide an excel file as save-as is pretty simple like below. What should i change in the below to make the cookie setting work in WebSphere?

 
pawan chopra
Ranch Hand
Posts: 415
jQuery Mac Objective C
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Phani Kiran Rudravarapu wrote:Hi,

We are facing something similar issue. We need to give a progress bar for file downloads and we are thinking of using jquery.download.js
This involves setting response's header with a cookie. When we tested this on our local machine with Tomcat it works fine.
But when we put it on Websphere it doesn't.

We can't try CookiesConfigureNoCache=false setting as getting admin access and modifying this property might be a bureaucratic nightmare.

In the link shared in above posts, i couldn't get what exactly this means "So if we just set the Cache-Control header after all the cookie processing was complete, the header would then be passed unmolested to the client".

Our code to provide an excel file as save-as is pretty simple like below. What should i change in the below to make the cookie setting work in WebSphere?



I don't remember exactly but I know I changed between Content-Disposition values I think I tried inline and it worked. You can give it a try.
 
Phani Kiran Rudravarapu
Greenhorn
Posts: 3
Android Java MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your immediate reply. I tried using 'inline' instead of attachment and still same issue.
The file download works fine in Firefox but in IE i get a HTTP 500 Internal Server error.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic