The annotation does not seem to like that. Also, how would the caller
/ invoker specify if they want JSON or XML back?

[ERROR]Mojo:
[ERROR]    org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile
[ERROR]FAILED for project:
[ERROR]    com.hanaden:DemoRestful-WAR:war:1.0-SNAPSHOT
[ERROR]Reason:
[ERROR]com/service/impl/ServiceImpl.java.java:[23,10] annotation
values must be of the form 'name=value'
[ERROR]com/service/impl/ServiceImpl.java.java:[23,29] annotation
values must be of the form 'name=value'


On Sat, Feb 28, 2009 at 11:30 AM, Sergey Beryozkin
<[email protected]> wrote:
> Hi,
> You can do something like
>
> @Produces("application/xml", "application/json")
> public SomeType get() {}
>
> Cheers, Sergey
>
> -----Original Message-----
> From: hanasaki jiji [mailto:[email protected]]
> Sent: 28 February 2009 09:24
> To: [email protected]
> Subject: JAXRS : howto produce XML and JSON?
>
> How would you go about creating a jaxrs that can produce both JSON and
> XML based on what the caller wants?  Do you really need to write the
> class twice and annotate each differently?
>

Reply via email to