[opencms-dev] Sending Headers in OpenCMS 6.2.3 and WAS 6 [very tricky]
Chirouze Olivier
olivier.chirouze at volvo.com
Thu Oct 2 17:33:21 CEST 2008
Hi,
I'd like to discuss a very technical question with some developpers out here.
I have found the reason of a bug I have on WebSphere and fckeditor (you can't choose any image). The bug is here: http://bugzilla.opencms.org/show_bug.cgi?id=1650
Now, I _do_ know where is the problem, but my solutions so far not so clean.
I understood it was due to a wrong "content-type" header, thanks to this discussion: http://fckeditor.biz/viewtopic.php?t=1185. So, the _fckeditor_ error is in fact due to _WebSphere_ that would return "text/html" instead of "text/xml" for Tomcat, when the user clicks "browser server". This is what happens when requesting file system/workplace/editors/fckeditor/filebrowser/connector.jsp.
So, in a word, the content-type returned for the same jsp file is different between Tomcat and WebSphere. Then I found this very interesting, old thread in our mailing list: http://mail.opencms.org/pipermail/opencms-dev/2007q1/027910.html (I took the same subject for my message).
I actually have the answer to "why is my content-type NOT set with WebSphere?".
There are two reasons to that:
- for some reason, it seems you can't set the Content in a jsp context in WebSphere except with contentType="" attribute: that looks amazing to me but I am sure of that after a bunch of tests.
- if no contentType="" attribute is set in the jsp page, then a default one is: "text/html".
That's a big pb with file connector.jsp, as the content type would be different depending on the action.
The only solution I found so far is:
- jsp file: force contentType="special_value"
- in FlexResponse (the OpenCms HTTPResponse wrapper) => do not set contentType if == "special_value"
- after the page has been loaded with CmsJspLoader => re-set the value that was supposed to be set ("text/html" or "text/xml")...
I want to provide my fix to the comunity, but if someone could help find a more elegant solution, I'm welcome for discussion, tests, etc.
Thanks!
Olivier
Olivier CHIROUZE
I&0 Infrastructure
Volvo Information Technology
402 avenue Charles de Gaulle * phone: +33 (0)4.72.96.89.39
API: VNX 0A0 0 02 6 telecopy: +33(0)4.72.96.76.80
69635 VĂ©nissieux Cedex - France * olivier.chirouze at volvo.com <mailto:olivier.chirouze at external.renault-trucks.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20081002/d96ce25a/attachment.htm>
More information about the opencms-dev
mailing list