assume that I have class like this
public class Entity {
private String name;
private File file;
// Getters & setters
}
is it possible to return object of this class as json? I'm using jax-rs
assume that I have class like this
public class Entity {
private String name;
private File file;
// Getters & setters
}
is it possible to return object of this class as json? I'm using jax-rs
Yes, you can.
If you're using JAX-RS, then I expect you to know the basic of creating a REST-ful Web Services ya.
You can use @Produces("application/json")
annotation in one of your endpoint. Use that endpoint to return an Entity, and it will be automatically converted as JSON.