|
From: ignou_mca <bbs...@co...> - 2013-12-19 11:02:44
|
Hi william,
Thanks for your response, Sorry for missing out the application context name
from the URI but my main question was I don't want to create the Details bean
but want the response of products,accounts and customers in GET
http://localhost:8080/application_context/details .
Not sure if it is possible without the Bean class,
Thanks
Ignou
> That's weird you have to bind your resources URI to the root URL. Usually
> we also have the application context(sometimes also the rest context) before
> the resource URI:
> http://localhost:8080/{APP_CONTEXT}/products
> http://localhost:8080/{APP_CONTEXT}/accounts
> http://localhost:8080/{APP_CONTEXT}/customers
>
> To achieve what you want with details, you can create a bean
> that aggregate all information and return it from the JAX-RS resource:
> public class Details{ public List<Product> products; public
> List<Customer> customers;
> public List<Accounts> accounts;
>
> // get and sets
> }
> Then expose this bean from a JAX-RS resource:
> @Path("details")public class DetailsResource{
> public Details getDetails(){ Details details; // retrieve
> Details return details; }
> }
>
>
> --
> William Antônio Siqueira
> Java Support Analyst
> http://fxapps.blogspot.comhttp://www.williamantonio.wordpress.com
> http://williamprogrammer.com
>
> 2013/12/19 ignou_mca <bbs...@co...>
> Hi Team,
> I am working on a rest application on which I have model for the following
> objects customers ,accounts and products.
> User can access the details of customers,accounts and products using the
> following uri.
>
> [1] GET http://localhost:8080/customers
> [2] GET http://localhost:8080/accounts
> [3] GET http://localhost:8080/products
>
> Now my requirement is to combine the responses of the above 3 services in one
> service, i.e. when user will try GET http://localhost:8080/details then he can
> get all the customers , accounts and products info on the response.
>
> Is there any thing on RESTEASY which will help me to implement this
> functionality.I don't want change anything on the model class or want to
> add
> any new model like details.
>
> Thanks
> Ignou
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
> Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktr
> k
> _______________________________________________
> Resteasy-users mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
|
|
From: ignou_mca <bbs...@co...> - 2013-12-19 14:10:13
|
Hi William,
Thanks for your response, Can we use atom feed in this scenario?
If yes if any one can provide some sample that will be great help.
Thanks
Ignou
> Hi Ignou,
> In this case I believe you will have to create the XML manually in the jax-rs
> resource method body and return it as String, or you can manage to do this
> using a MessageBodyWriter/Reader.
> However, I think someone else might have some better alternative to achieve
> this--
> William Antônio Siqueira
> Java Support Analyst
> http://fxapps.blogspot.comhttp://www.williamantonio.wordpress.com
> http://williamprogrammer.com
>
> 2013/12/19 ignou_mca <bbs...@co...>
> Hi william,
> Thanks for your response, Sorry for missing out the application context name
> from the URI but my main question was I don't want to create the Details
> bean
> but want the response of products,accounts and customers in GET
> http://localhost:8080/application_context/details .
>
> Not sure if it is possible without the Bean class,
>
> Thanks
> Ignou
>
>
> > That's weird you have to bind your resources URI to the root URL.
> Usually
> > we also have the application context(sometimes also the rest context) before
> > the resource URI:
> > http://localhost:8080/{APP_CONTEXT}/products
> > http://localhost:8080/{APP_CONTEXT}/accounts
> > http://localhost:8080/{APP_CONTEXT}/customers
> >
> > To achieve what you want with details, you can create a bean
> > that aggregate all information and return it from the JAX-RS resource:
> > public class Details{ public List<Product> products; public
> > List<Customer> customers;
> > public List<Accounts> accounts;
> >
> > // get and sets
> > }
> > Then expose this bean from a JAX-RS resource:
> > @Path("details")public class DetailsResource{
> > public Details getDetails(){ Details details; // retrieve
> > Details return details; }
> > }
> >
> >
> > --
> > William Antônio Siqueira
> > Java Support Analyst
> > http://fxapps.blogspot.comhttp://www.williamantonio.wordpress.com
> > http://williamprogrammer.com
> >
> > 2013/12/19 ignou_mca <bbs...@co...>
> > Hi Team,
> > I am working on a rest application on which I have model for the
> following
> > objects customers ,accounts and products.
> > User can access the details of customers,accounts and products using the
> > following uri.
> >
> > [1] GET http://localhost:8080/customers
> > [2] GET http://localhost:8080/accounts
> > [3] GET http://localhost:8080/products
> >
> > Now my requirement is to combine the responses of the above 3 services in
> one
> > service, i.e. when user will try GET http://localhost:8080/details then he
> can
> > get all the customers , accounts and products info on the response.
> >
> > Is there any thing on RESTEASY which will help me to implement this
> > functionality.I don't want change anything on the model class or want to
> > add
> > any new model like details.
> >
> > Thanks
> > Ignou
> >
> >
> ------------------------------------------------------------------------------
> > Rapidly troubleshoot problems before they affect your business. Most IT
> > organizations don't have a clear picture of how application performance
> > affects their revenue. With AppDynamics, you get 100% visibility into your
> > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of
> AppDynamics
> > Pro!
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktr
> > k
> > _______________________________________________
> > Resteasy-users mailing list
> > Res...@li...
> > https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
> Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktr
> k
> _______________________________________________
> Resteasy-users mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
|
|
From: William A. S. <wil...@gm...> - 2013-12-19 11:06:39
|
Hi Ignou, In this case I believe you will have to create the XML manually in the jax-rs resource method body and return it as String, or you can manage to do this using a MessageBodyWriter/Reader. However, I think someone else might have some better alternative to achieve this -- *William Antônio Siqueira* *Java Support Analyst* *http://fxapps.blogspot.com <http://fxapps.blogspot.com>* *http://www.williamantonio.wordpress.com <http://www.williamantonio.wordpress.com>* *http://williamprogrammer.com <http://williamprogrammer.com>* 2013/12/19 ignou_mca <bbs...@co...> > Hi william, > Thanks for your response, Sorry for missing out the application context > name > from the URI but my main question was I don't want to create the Details > bean > but want the response of products,accounts and customers in GET > http://localhost:8080/application_context/details . > > Not sure if it is possible without the Bean class, > > Thanks > Ignou > > > > That's weird you have to bind your resources URI to the root URL. Usually > > we also have the application context(sometimes also the rest context) > before > > the resource URI: > > http://localhost:8080/{APP_CONTEXT}/products > > http://localhost:8080/{APP_CONTEXT}/accounts > > http://localhost:8080/{APP_CONTEXT}/customers > > > > To achieve what you want with details, you can create a bean > > that aggregate all information and return it from the JAX-RS resource: > > public class Details{ public List<Product> products; public > > List<Customer> customers; > > public List<Accounts> accounts; > > > > // get and sets > > } > > Then expose this bean from a JAX-RS resource: > > @Path("details")public class DetailsResource{ > > public Details getDetails(){ Details details; // > retrieve > > Details return details; } > > } > > > > > > -- > > William Antônio Siqueira > > Java Support Analyst > > http://fxapps.blogspot.comhttp://www.williamantonio.wordpress.com > > http://williamprogrammer.com > > > > 2013/12/19 ignou_mca <bbs...@co...> > > Hi Team, > > I am working on a rest application on which I have model for the > following > > objects customers ,accounts and products. > > User can access the details of customers,accounts and products using the > > following uri. > > > > [1] GET http://localhost:8080/customers > > [2] GET http://localhost:8080/accounts > > [3] GET http://localhost:8080/products > > > > Now my requirement is to combine the responses of the above 3 services > in one > > service, i.e. when user will try GET http://localhost:8080/details then > he can > > get all the customers , accounts and products info on the response. > > > > Is there any thing on RESTEASY which will help me to implement this > > functionality.I don't want change anything on the model class or want to > > add > > any new model like details. > > > > Thanks > > Ignou > > > > > ------------------------------------------------------------------------------ > > Rapidly troubleshoot problems before they affect your business. Most IT > > organizations don't have a clear picture of how application performance > > affects their revenue. With AppDynamics, you get 100% visibility into > your > > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics > > Pro! > > > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktr > > k > > _______________________________________________ > > Resteasy-users mailing list > > Res...@li... > > https://lists.sourceforge.net/lists/listinfo/resteasy-users > > > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics > Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users > > |