[opencms-dev] Response-ContentType XML with OpenCms (JSP) ?

Hendrik Konitzer h.konitzer at durato.eu
Wed Sep 2 13:23:49 CEST 2009


Thank you, Michael!

This works perfect:

CmsFlexController controller = CmsFlexController.getController(request);
controller.getTopResponse().setContentType("text/xml");


much obligated,
Hendrik


Michael Moossen schrieb:
> Hi Hendrik!
>
> you have to use something like this:
>
> // set the mime type to application/json
> CmsFlexController controller = 
> CmsFlexController.getController(getRequest());
> controller.getTopResponse().setContentType("application/json");
>
> HTH
> -------------------
> Michael Moossen
>
> Alkacon Software GmbH  - The OpenCms Experts
> http://www.alkacon.com - http://www.opencms.org
>
> Hendrik Konitzer schrieb:
>   
>> Hi,
>>
>> were trying to generate a XML-Output via JSP to process es further with 
>> jQuery.
>>
>> But the problem is, the returned Contenttype for the response is always 
>> text/html and therefore, jQuery refuses the processing.
>>
>> We set the Content-Type in the JSP with various methods, directly with 
>> <% response.setContentType("text/xml;charset=UTF-8");%> or as page 
>> directive like <%@ page contentType="text/xml; charset=UTF-8"%>.
>>
>> But the response is always text/html, it seems that OpenCms forced the 
>> ContentType to this.
>>
>> Therefore, when it comes to (jQuery Javascript): 
>> $.post("joedoe.jsp",{},processXML(data),"xml"); - it fails.
>>
>> How to set the ContentType of the response of OpenCms-JSPs to other than 
>> "text/html" ?
>>
>> Thanks for attention,
>>     
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>   


-- 
Hendrik Konitzer

:: Kontaktdaten ::
Durchwahl: + 49 261 296 3439 - 133
E-mail: h.konitzer at durato.de <mailto:h.konitzer at durato.de> | Skype: 
hendrikkonitzer <skype:hendrikkonitzer?chat>
V-Card: vcards.durato.de <http://vcards.durato.de>
::
durato Ltd.
Pastor-Klein-Str. 17E
56073 Koblenz
Tel.: + 49 261 296 3439 - 0 | Fax: + 49 261 296 3439 - 199
Email: info at durato.de <mailto:info at durato.de> | URL: www.durato.de 
<http://www.durato.de>
::
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20090902/28093d6d/attachment.htm>


More information about the opencms-dev mailing list