Below is my routing
public Restlet createInboundRoot(){
Router router = new Router(getContext());
router.attach("account/profile",UserProfile.class);
Following is the Resource class UserProfile.java
@post
@path("add")
public void addUser(User user){
@post
@path("modify")
public void modifyUser(User user){
@post
public void test(){//only this is called
I want to invoke one resource class and do couple of identical functions for a resource class. That means, my above resource class handles functions related to the UserProfiles such as add, modify.
URL are:
account/profile/add => to add a user
account/profile/modify => to modify a user
anyway, above my implementation doesn't work as only the test() method can be invoked through account/profile/
I tried with Pathparams as well.But it also didnot work. For path params:
router.attach("account/profile/{action}",UserProfile.class);
was added and in the resource class,
@post
@path("{action}")
public void addUser(@pathparam("action") String action, User user){
Anyone tell me where is my problem.