0

I am using Jersey in my Web-application. The data sent to the server is in JSON format, which in turn is unmarshalled at the server-end and the object obtained is used in further processing. The security audit raised some vulnerabilities for this approach.

public Response registerManga(MangaBean mBean){
System.out.println(mBean);
return Response.status(200).build();
}

MangaBean:

public class MangaBean {
public String title;
public String author;

@Override
public String toString() {
    return "MangaBean [title=" + title + ", author=" + author + "]";
}
public String getTitle() {
    return title;
}
public void setTitle(String title) {
    this.title = title;
}
public String getAuthor() {
    return author;
}
public void setAuthor(String author) {
    this.author = author;
}
}
vamsi
  • 381
  • 5
  • 10
  • I think you are looking for this: https://jersey.java.net/documentation/latest/bean-validation.html. For parse exceptions see http://stackoverflow.com/questions/28231323/jersey-jackson-how-to-catch-json-mapping-exception – Meiko Rachimow Apr 01 '16 at 00:03
  • Possible duplicate of [Jersey/JAX-RS resource method input bean validation](http://stackoverflow.com/questions/27389629/jersey-jax-rs-resource-method-input-bean-validation) – Meiko Rachimow Apr 01 '16 at 00:04
  • and http://stackoverflow.com/questions/14218159/how-to-handle-resource-validation-in-rest-webservices – Meiko Rachimow Apr 01 '16 at 00:06

0 Answers0