You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Brad <cf...@javawork.co.uk> on 2008/06/19 11:24:35 UTC
how to produce html output in REST service
Hi,
what's the recommended way of getting CXF to output HTML in a REST
service? From looking at the available providers I'm thinking that one
solution would be to have my method return a Response with the
enitity set to an String and the media type set to text/html.
Is there a better way of doing it?
Thanks,
Brad.
Re: how to produce html output in REST service
Posted by Sergey Beryozkin <se...@iona.com>.
Hi Brad
If you're using Atom then may be the best way would be to update the existing Atom provider to also
ProduceMime("application/xhtml+xml") and then if the mediatype in writeTo is the same then use one of the Abdera utility classes to
transfrom the feed into xhtml, I don't remeber the name of that class offhand, but it should a one-line call.
Perhaps alternatively is to have a dedicated XHTML provider and have a response entity returned in the XML format,
so that this dedicated can transform the entity using xslt or some other technoques...
Cheers, Sergey
----- Original Message -----
From: "Brad" <cf...@javawork.co.uk>
To: <us...@cxf.apache.org>
Sent: Thursday, June 19, 2008 10:24 AM
Subject: how to produce html output in REST service
> Hi,
>
> what's the recommended way of getting CXF to output HTML in a REST
> service? From looking at the available providers I'm thinking that one
> solution would be to have my method return a Response with the
> enitity set to an String and the media type set to text/html.
>
> Is there a better way of doing it?
>
> Thanks,
> Brad.
----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland