Reputation: 135
I have an applicationPath called: /web, and after the /web, I want to use a single class, every put, delete, post, update method in code looks like:
@ApplicationPath("/web")
public class If3WebApplication extends Application {
}
And in this class I would like to handle the all http method:
@Path("/*") //this is not working...
public class OAuthToken{
private HashMap<String, String> endpointMap = new LinkedHashMap<>();
@PostConstruct
public void init(){
endpointMap.put("token", "/token"); // here will be all urls
}
@POST
@Consumes("application/x-www-form-urlencoded")
@Produces("text/plain")
public void get(){
.....
}
So I want to the OAuthToken to handle all post methods which comes to /web/url and post method... but the @Path("/*") not working... What is the best way to do the magic? Thanks for the help!
Upvotes: 0
Views: 59
Reputation: 1129
You can try using the expression for Jersey as below
@Path("{any: .*}")
Upvotes: 2