È possibile restituire un errore HTTP da un'interfaccia RESTeasy? Attualmente sto usando web-filtri incatenati per questo, ma voglio sapere se è possibile direttamente dalla interfaccia ...Restituisce errore HTTP dall'interfaccia RESTeasy
Esempio sudo-code:
@Path("/foo")
public class FooBar {
@GET
@Path("/bar")
@Produces("application/json")
public Object testMethod(@HeaderParam("var_1") @DefaultValue("") String var1,
@HeaderParam("var_2") @DefaultValue("") String var2 {
if (var1.equals(var2)) {
return "All Good";
} else {
return HTTP error 403;
}
}
}