On Monday, October 22, 2012 at 11:25 AM, Daniel Bevenius wrote:
Do you have something in mind for HTTP responses?At the moment, the only support for responses is taking what isreturned from the target method, and depending on what the value of'produces' is and what the client requested, that type will bereturned.This is what one of the RESTful routes looks like in aerogear-controller-demo:route().from("/hello2").consumes("*/*").on(RequestMethod.GET).produces("application/json").to(HelloRest.class).hello(queryParam(String.class,"firstname"), queryParam(String.class, "lastname"));So, this produces a JSON response and RestEasy will to this mapping:HTTP/1.1 200 OKServer: Apache-Coyote/1.1Content-Type: application/jsonTransfer-Encoding: chunkedDate: Mon, 22 Oct 2012 13:19:15 GMT{"msg":"Hello Daniel Bevenius"}We can certainly add other things and if you let me know what you'dlike to see I'll take a stab at it.Perhaps we could have something like this:route().from("/hello2").consumes("*/*").on(RequestMethod.GET).produces("application/json").response(statusCodeMethodName(msg)).to(HelloRest.class).hello(queryParam(String.class,"firstname"), queryParam(String.class, "lastname"));What do you think?On 22 October 2012 15:06, Bruno Oliveira <bruno@abstractj.org> wrote:Awesome Daniel,Do you have something in mind for HTTP responses?--"The measure of a man is what he does with power" - Plato-@abstractj-Volenti Nihil DifficileOn Friday, October 19, 2012 at 9:24 AM, Daniel Bevenius wrote:Hi everyone,I've updated the section "Programmatic endpoint configuration inRestEasy" in the gist (https://gist.github.com/3871798) with progressmade the last few days. Hopefully this will explain how the currentconfiguration works and what options it supports.If this looks alright, I'll shift focus back to aerogear-controller,and look into adding support for things like query/form/headerparameters etc. This will enable us to update aerogear-controller demowith more examples and that way get a better feel for how using theprogrammatic configuration works in real life as opposed to tests.cheers,/Dan_______________________________________________aerogear-dev mailing list_______________________________________________aerogear-dev mailing list_______________________________________________aerogear-dev mailing list