We would like to create a \"WebService\" which return a list of specific objects. And we would like to call this webservice from another java program by apache http clients libr
@ResponseBody will automatically encode the object you return to appropriate formats based on the Accept header of the request and the presence of JSON and/or XML libraries in the classpath.
It can be easier/safer to define your own object to wrap the list in though rather than returning the list directly - as that gives you more control over the encoding and also allows you to potentially add other data in the future.