You can map requests based upon HTTP methods like the GET and POST and various other parameters. For examples, if you are developing RESTful Web Service using Spring then you can use produces and consumes property along with media type annotation to indicate that this method is only used to produce or consumers JSON as shown below:
You can similarly create other handler methods to produce JSON or XML.
We just sent you an email. Please click the link in the email to confirm your subscription!