URL would be - http://localhost:8080<http://localhost:8080/myresources/test>
/{context_path}/rest/myresources

Please don't forget to add  "org.xwiki.contrib.**rest.HelloWordResource"
into component.txt file.


On Thu, Aug 11, 2011 at 1:05 AM, Mark Wallace <[email protected]>wrote:

> Looking at http://platform.xwiki.org/**xwiki/bin/view/Features/**
> XWikiRESTfulAPI#**HCustomresources.<http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI#HCustomresources.>
> ..
>
> If I create this class:
>
>   package org.xwiki.contrib.rest;
>
>   import javax.ws.rs.DefaultValue;
>   import javax.ws.rs.GET;
>   import javax.ws.rs.Path;
>
>   import org.xwiki.component.**annotation.Component;
>   import org.xwiki.rest.XWikiResource;
>
>   @Component("org.xwiki.contrib.**rest.HelloWordResource")
>   @Path("/myresources/{**myresourcename}")
>   class HelloWorldResource extends XWikiResource {
>      @GET
>      public String get(@PathParam("**myresourcename")
>  @DefaultValue("world") String myresourcename)
>      {
>        return "Hello " + myresourcename;
>      }
>   }
>
> Then what is the exact URI I use to access it.  E.g. something like
> http://localhost:8080/**myresources/test<http://localhost:8080/myresources/test>?
>  Not sure exactly what full URL is.
>
> Thanks,
>  -Mark
>
>
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
>
>
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to