<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">====> Could I access this only via a JSON request (e.g. "curl -v -H </span><span style="font-family:arial,sans-serif;font-size:13px">"Content-type: application/json" -X GET http........./cars/123") or </span><span style="font-family:arial,sans-serif;font-size:13px">also via browser (http://......../cars/123) ?</span><div style>
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.</div>
<div style><br></div><div style><span style="font-family:arial,sans-serif;font-size:13px">==> Can that be differentiated ? (e.g. path, query) Not sure I</span><span style="font-family:arial,sans-serif;font-size:13px">understand the above - perhaps an example helps?</span><br>
</div><div style><span style="font-family:arial,sans-serif;font-size:13px">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. </span></div>
<div style><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div style><span style="font-family:arial,sans-serif;font-size:13px">==> What happens with header "foo" and param "foo" ?</span><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div style><span style="font-family:arial,sans-serif;font-size:13px">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!</span></div>
<div style><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div style><span style="font-family:arial,sans-serif;font-size:13px">==>1) Should we add a link to </span><a href="http://aerogear.org/docs/specs/aerogear-controller/org/jboss/aerogear/controller/router/rest/pagination/PaginationInfo.html" target="_blank" style="font-family:arial,sans-serif;font-size:13px">http://aerogear.org/docs/specs/aerogear-controller/org/jboss/aerogear/controller/router/rest/pagination/PaginationInfo.html</a><span style="font-family:arial,sans-serif;font-size:13px">?</span><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div style><span style="font-family:arial,sans-serif;font-size:13px">Certainly, no problems.</span></div><div style><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div style><span style="font-family:arial,sans-serif;font-size:13px">==>2) NOT needed (not now) - but perhaps a simple PaginationStrateg </span><span style="font-family:arial,sans-serif;font-size:13px">could be shown (or a link to a test case that tests a custom </span><span style="font-family:arial,sans-serif;font-size:13px">PaginationStrategy)?</span><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div style><span style="font-family:arial,sans-serif;font-size:13px">Yep, nps.</span></div><div style><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div style><span style="font-family:arial,sans-serif;font-size:13px">==>where would I typically be implementing a CORS CDI Producer?</span><br style="font-family:arial,sans-serif;font-size:13px">
</div><div style><span style="font-family:arial,sans-serif;font-size:13px">In your deployment that contains the Routes. Or do you perhaps mean when would you typically implement one?</span></div><div style><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div style><span style="font-family:arial,sans-serif;font-size:13px">Thanks for the feedback!</span></div><div style><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div style><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div style><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div style><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></div><div class="gmail_extra"><br><br>
<div class="gmail_quote">On 19 March 2013 09:23, Matthias Wessendorf <span dir="ltr"><<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I read the guide<br>
(<a href="http://staging.aerogear.org/docs/guides/aerogear-controller/" target="_blank">http://staging.aerogear.org/docs/guides/aerogear-controller/</a>) nice<br>
work!!!!<br>
<br>
However I have a few questions:<br>
<br>
<br>
=====<br>
<br>
<a href="http://staging.aerogear.org/docs/guides/aerogear-controller/routes.html" target="_blank">http://staging.aerogear.org/docs/guides/aerogear-controller/routes.html</a><br>
<br>
1)<br>
public class Routes extends AbstractRoutingModule {<br>
<br>
@Override<br>
public void configuration() {<br>
route()<br>
.from("/cars/{id}")<br>
.on(RequestMethod.GET)<br>
.produces(JSON)<br>
.to(Cars.class).findById(param("id"));<br>
}<br>
<br>
<br>
====> Could I access this only via a JSON request (e.g. "curl -v -H<br>
"Content-type: application/json" -X GET http........./cars/123") or<br>
also via browser (http://......../cars/123) ?<br>
<br>
<br>
2)<br>
Parameters<br>
Route endpoints currently support the following types of parameters<br>
which are all configured by using the param method:<br>
<br>
Path<br>
Query<br>
Form<br>
Header<br>
Cookie<br>
<br>
==> Can that be differentiated ? (e.g. path, query) Not sure I<br>
understand the above - perhaps an example helps?<br>
==> What happens with header "foo" and param "foo" ?<br>
<br>
<br>
<br>
<br>
<a href="http://staging.aerogear.org/docs/guides/aerogear-controller/pagination.html" target="_blank">http://staging.aerogear.org/docs/guides/aerogear-controller/pagination.html</a><br>
<br>
1) Should we add a link to<br>
<a href="http://aerogear.org/docs/specs/aerogear-controller/org/jboss/aerogear/controller/router/rest/pagination/PaginationInfo.html" target="_blank">http://aerogear.org/docs/specs/aerogear-controller/org/jboss/aerogear/controller/router/rest/pagination/PaginationInfo.html</a>?<br>
<br>
2) NOT needed (not now) - but perhaps a simple PaginationStrategy<br>
could be shown (or a link to a test case that tests a custom<br>
PaginationStrategy)?<br>
<br>
<br>
<br>
<a href="http://staging.aerogear.org/docs/guides/aerogear-controller/cors.html" target="_blank">http://staging.aerogear.org/docs/guides/aerogear-controller/cors.html</a><br>
<br>
1) where would I typically be implementing a CORS CDI Producer?<br>
<br>
<br>
<br>
<br>
Nice work!<br>
<span class="HOEnZb"><font color="#888888"><br>
-Matthias<br>
<br>
--<br>
Matthias Wessendorf<br>
<br>
blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>
sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a><br>
_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
</font></span></blockquote></div><br></div>