[aerogear-dev] {AG Controller - User Guide} A few questions
Daniel Bevenius
daniel.bevenius at gmail.com
Tue Mar 19 04:49:58 EDT 2013
====> Could I access this only via a JSON request (e.g. "curl -v -H
"Content-type:
application/json" -X GET http........./cars/123") or also via browser
(http://......../cars/123) ?
One would need to specify the "Accept: application/json" header (not the
'Content-Type' header as it specified the content of the body being sent)
to tell the controller what type the data should be in the response. This
would not work via a browser as it would set an accept header of
"text/html". If one added JSP to the produces method it would work, as long
as a view also exists that is.
==> Can that be differentiated ? (e.g. path, query) Not sure Iunderstand
the above - perhaps an example helps?
Actually there is only a single way to specify a param for route endpoints.
We discussed having methods for different types, like pathParam,
headerParam, etc, but it was decided to go with a single param.
==> What happens with header "foo" and param "foo" ?
Good questions! In the current implementation the param "foo" would be the
only one used and the header param foo would simple be ignored. I'll create
a jira for this issue and look into it. Thanks!
==>1) Should we add a link to
http://aerogear.org/docs/specs/aerogear-controller/org/jboss/aerogear/controller/router/rest/pagination/PaginationInfo.html
?
Certainly, no problems.
==>2) NOT needed (not now) - but perhaps a simple PaginationStrateg could
be shown (or a link to a test case that tests a custom PaginationStrategy)?
Yep, nps.
==>where would I typically be implementing a CORS CDI Producer?
In your deployment that contains the Routes. Or do you perhaps mean when
would you typically implement one?
Thanks for the feedback!
On 19 March 2013 09:23, Matthias Wessendorf <matzew at apache.org> wrote:
> Hi,
>
> I read the guide
> (http://staging.aerogear.org/docs/guides/aerogear-controller/) nice
> work!!!!
>
> However I have a few questions:
>
>
> =====
>
> http://staging.aerogear.org/docs/guides/aerogear-controller/routes.html
>
> 1)
> public class Routes extends AbstractRoutingModule {
>
> @Override
> public void configuration() {
> route()
> .from("/cars/{id}")
> .on(RequestMethod.GET)
> .produces(JSON)
> .to(Cars.class).findById(param("id"));
> }
>
>
> ====> Could I access this only via a JSON request (e.g. "curl -v -H
> "Content-type: application/json" -X GET http........./cars/123") or
> also via browser (http://......../cars/123) ?
>
>
> 2)
> Parameters
> Route endpoints currently support the following types of parameters
> which are all configured by using the param method:
>
> Path
> Query
> Form
> Header
> Cookie
>
> ==> Can that be differentiated ? (e.g. path, query) Not sure I
> understand the above - perhaps an example helps?
> ==> What happens with header "foo" and param "foo" ?
>
>
>
>
> http://staging.aerogear.org/docs/guides/aerogear-controller/pagination.html
>
> 1) Should we add a link to
>
> http://aerogear.org/docs/specs/aerogear-controller/org/jboss/aerogear/controller/router/rest/pagination/PaginationInfo.html
> ?
>
> 2) NOT needed (not now) - but perhaps a simple PaginationStrategy
> could be shown (or a link to a test case that tests a custom
> PaginationStrategy)?
>
>
>
> http://staging.aerogear.org/docs/guides/aerogear-controller/cors.html
>
> 1) where would I typically be implementing a CORS CDI Producer?
>
>
>
>
> Nice work!
>
> -Matthias
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20130319/6adc61b7/attachment-0001.html
More information about the aerogear-dev
mailing list