My code actually contains one resource class and one BEan class it's return type is JSON.
Resource Class
@Path("/json")
public class JSONRetrive {
@GET
@Produces(MediaType.APPLICATION_JSON)
public JSONT getJson(){
JSONT jsont = new JSONT();
jsont.setJsont("inr");
return jsont;
}
}
/* Is there any Annotation will represent JSON. Do i need to use any other Annotation for this.*/
My Bean class
//@XmlRootElement
public class JSONT {
private String jsont;
public String getJsont() {
return jsont;
}
public void setJsont(String jsont) {
this.jsont = jsont;
}
}
If i uncomment @XmlRootElement it is working fine is there any other alternative solution for this