A very brief (and simple) example of the principle behind harnessing Jersey's content negotiation ability whilst taking advantage of JAXB to marshall a bean from a Java Object to XML/JSON:
And the resource:
Testing the resource(s) using curl:
Which would yield:
or:
Which would yield:
Subscribe to:
Post Comments (Atom)
Blog archive
-
▼
2010
(43)
-
▼
June
(8)
- XQDT: Notes for installing the current Milestone o...
- MarkLogic: XQuery: performance with Maps
- Java: Using Jersey with JAXB to output XML or JSON.
- MarkLogic: XQuery: hacking the position() - a basi...
- MarkLogic: XQuery: and / and-not query examples
- MarkLogic: XQuery: UNIX Timestamp to xs:dateTime C...
- MarkLogic: XCC/J: Passing a node() into a Query as...
- MarkLogic: XQuery: Typeswitching based on input "t...
-
▼
June
(8)

2 comments:
Thanks for the Sample, especially your curl example to call the service in JSON mode.
I completed an service that produces both XML and JSON, When invoking it was always giving XML as I was missing Accept: application/json
Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training in India . Nowadays Java has tons of job opportunities on various vertical industry.
or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry.
Post a comment