@PUT
@Consumes("application/json")
public ReturnCodeBean saveWidget(WidgetBean widget) {
try {
WidgetStore ws = new WidgetStore();
ws.set(widget);
} catch(Exception e) {
throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND)
.entity("Widget save failed.").build());
}
return new ReturnCodeBean(ReturnCodeBean.SUCCESS,"Saved");