I am developing Java "JAX-RS" Web Services for books and contents. There will be 100s of URLs something similar ...
...
To fetch the chapter content user needed to POST authToken, which I validate in server and return content or error. The sample code ...
@Path("/book1")
public class Book1 {
@Path("/chapter/{cNum}")
public String getMedias(
@PathParam("cNum") String cNum,
@FormParam("authToken") String authToken) {
// so here I validate the authToken
return "bla bla!";
}
}
This works perfectly. But I repeated @FormParam("authToken") in all 100s of methods like above. Is there a way that I can check only one time somewhere and remove from all methods? Thank you so much!
Aucun commentaire:
Enregistrer un commentaire