Need DPM page to respond with RSS+XML MIME type

Options

HI,

I am using a DPM build (VCM 8.0 / VAP 8.1) on Tomcat.  I've created an RSS feed with a grid and content-publisher portlet. 

But the portal always responds with "text/html" instead of "application/rss+xml" in the HTTP header.  Below is part of an example response header:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=9783227D8AB1BFB04C0A0507E7BDD92E; Path=/sitename
Set-Cookie: VignettePortal-NavTreeState-sitename=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
Cache-Control: no-cache
Content-Type: text/html;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 11 Jul 2011 14:24:30 GMT
 

I tried putting these JSP lines in both grid and portlet, but portal still insists on "text/html":

<%@ page contentType="application/rss+xml" pageEncoding="UTF-8" %>

<% response.setContentType("application/rss+xml;charset=UTF-8"); %>
 

Also tried adding the MIME type to the portal web.xml file as below and create an "rss" presentation format just to get the ".rss" extension in the URL, but it didn't help either. 

<mime-mapping>
            <extension>rss</extension>
            <mime-type>application/rss+xml</mime-type>
</mime-mapping>
 

Anybody know of a way to force the portal to respond with a MIME type other than "text/html" on a DPM template?

Comments

  • Hello Jeffrey,

    I do not believe the Content-Type header can be set or overriden through Portal product configuration or API.

    That said, one solution would be to override the header using a custom servlet filter.  OpenText KB article 17551988 describes the rough steps for overriding response headers using a custom filter.  Article 17538266 outlines the support ramifications of adding custom servlet filters to Portal.

    There are many examples online.  Remeber to add logic to the filter so that it only applies to responses for the page you are concearned with.

    Kind Regards
    Alex

  • Did you get this to work? I am facing same issue and would be glad if you can help me a bit.....

    Thanks

    -Naresh

  • Do you have any solutions in 2022? This is definitely not the server's fault.