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

Hendrik Konitzer h.konitzer at durato.eu
Wed Sep 2 11:24:15 CEST 2009


were trying to generate a XML-Output via JSP to process es further with 

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,
Hendrik Konitzer

More information about the opencms-dev mailing list