Thanks. I did indeed forget components.txt! But I fixed that.
Trying this to test:
curl
http://localhost:8080/xwiki/rest/myresources/1
but not working I don't think. I get an html page that says
The server has not found anything matching the request URI
What am I doing wrong?
Thanks for any help you can provide,
-Mark
On 8/10/2011 4:04 PM, Karamjit Singh wrote:
URL would be -
http://localhost:8080/{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 wrote:
Looking at
http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI#HCustomre….
..
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?
Not sure exactly what full URL is.
Thanks,
-Mark
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs