• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

setting header in websphere 8.

 
Ranch Hand
Posts: 419
Mac jQuery Objective C
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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().
 
Greenhorn
Posts: 3
Android MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 419
Mac jQuery Objective C
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic