Hi Jakub,
this is right. I was trying to keep my examples and explanation simple.
What I really want to achieve is, to make it resource-independent. I
like to post a list of URLs (maybe even with some wildcards) to the
server, and there all the outputs will be joined and returned as one.
This gives a kind of a simple query language.
The last days I tried digging into the jersey source, however most
things I understood were always very close connected to web-server
functionality.
Thanks and Regards,
Stefan
2011/6/1 Jakub Podlesak <jakub.podlesak_at_oracle.com>:
> Hi Stefan,
>
> If the abc/1 abc/2 and join/1-2 are part of the very same
> JAX-RS application, then you should be able to do this quite easily:
>
> @Path("abc")
> public class AbcResource {
> @Path("{id}")
> @GET
> public String getAbc(@PathParam("id") String id) {
> return MyAppData.get(id);
> }
> }
>
> @Path("join")
> public class JoinResource {
> @Path("{ids}")
> @GET
> public String getJoin(@PathParam("ids") String ids) {
> JoinData result = new JoinData();
>
> for (String id : MyUtility.parseIds(ids)) {
> result.add(new AbcResource().getAbc(id));
> }
>
> return result.toString();
> }
> }
>
> But maybe i am missing something?
>
> ~Jakub
>
> On 05/31/2011 08:19 PM, Stefan Kaufmann wrote:
>>
>> Hello,
>>
>> I'm using Jersey Server in the main for it's main purpose, a REST Server.
>>
>> However, I like to add Rest-function which accumulates the output of
>> several URL-Paths.
>> basically I want to join the output http://server/abc/1 and
>> http://server/abc/2 by calling http://server/join/1-2 .
>>
>> The most obvious way would be, calling both urls - Jersey Server
>> internally, by avoiding http (and so the Webserver).
>>
>> Is this possible?
>>
>> Thanks in advance,
>> Stefan
>>
>
>