Discussion:
How can parent URI and sub URI in different classes
Zhanming Qi
2012-01-06 06:33:04 UTC
Permalink
Hi,

Found the way:
@Path("")// This is the point, change "/" to ""
public class IndexResource {
......
}

@Path("/login")
public class LoginResource {
......
}

Thanks.

--
View this message in context: http://jersey.576304.n2.nabble.com/How-can-parent-URI-and-sub-URI-in-different-classes-tp7157180p7157429.html
Sent from the Jersey mailing list archive at Nabble.com.
Zhanming Qi
2012-01-06 03:36:13 UTC
Permalink
Hi,

How can I make this happen?

domain<:port>/
domain<:port>/login
domain<:port>/signup
domain<:port>/signout

@Path("/")
public class IndexResource {
......
}

@Path("/login")
public class LoginResource {
......
}

and so on.

Now, I only can do this in one class.
@Path("/")
public class IndexResource {
@GET
public String index(){
....
}

@GET
@Path("/login")
public String loginGet(){
....
}
@POST
@Path("/login")
public String loginPost(){
....
}

@GET
@Path("/signup")
public String signUpGet(){
....
}
@POST
@Path("/signup")
public String signUpPost(){
....
}

@GET
@Path("/signout")
public String signOutGet(){
....
}
@POST
@Path("/signout")
public String signOutPost(){
....
}
......
}

Thanks.

--
View this message in context: http://jersey.576304.n2.nabble.com/How-can-parent-URI-and-sub-URI-in-different-classes-tp7157180p7157180.html
Sent from the Jersey mailing list archive at Nabble.com.

Loading...