论坛

主页 » Liferay Portal » English » 3. Development

组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
Tobias Rübner
change the mime-type of a portlet
2009年1月20日 上午3:23
答复

Tobias Rübner

等级: New Member

帖子: 10

加入日期: 2009年1月20日

最近的帖子

Hi there,

I want to change the content type of the portlet response from html to xml.
In the API I found the following method:
1RenderResponse.setContentType("application/xml+xhtml; charset=utf-8")


which gives me an unsupported-mime-type-error.

Im my portlet.xml I changed the supported mime-type for my portlet view to xml
1    <supports>
2        <mime-type>application/xml+xhtml</mime-type>
3        <portlet-mode>view</portlet-mode>
4    </supports>


I checked the RenderRequest.getResponseContentTypes() to review my possibilities and there is till only text/html available.

What can I do tho change this?