I will do that. Maybe it has something to do with the order the controller command and the JSON command are invoked. Thanks for your help.
Printable View
I will do that. Maybe it has something to do with the order the controller command and the JSON command are invoked. Thanks for your help.
Hi there,
I'm facing the same problem.
I did the following steps:
1. I created the entities and fields
2. added mvcCode:entity --class ~.domain.Product --testAutomatically
field string --fieldName name --notNull --sizeMin 2
3. updated my entitites (also added new ones)Code:controller all --package ~.web
4. added a finder
5. added json supportCode:finder add --class ~.domain.Product --finderName findProductsByClient
the generated method in the controller looks like this:Code:json add --class ~.domain.Product
For a workaround, I copied the method to my controller and added the @ResponseBody Annotation.Code:@RequestMapping(params = "find=ByClient", method = RequestMethod.GET, headers = "Accept=application/json")
public String ProductController.jsonFindProductsByClient(@RequestParam("client") Client client) {
return Product.toJsonArray(Product.findProductsByClient(client).getResultList());
}
I'm using roo 1.2.2.
Is there already a issue for that (I did not find anything related) or should I start a new one?