@At("/notes") @Service
public class NotebookService {
private Note note =new Note();
public NotebookService(){
ObjectifyService.register(Note.class);
}
public Note getNote() {
return note;
}
public void setNote(Note note) {
this.note = note;
}
@Post
public String postNote(){
note.setDate(new Date());
Objectify objectify=ObjectifyService.ofy();
objectify.save().entities(note).now();
return "/servlet";
}
}
It throws java.lang.ClassCastException: java.lang.String cannot be cast to com.google.sitebricks.headless.Reply when I return a url string from a method annotated with @post. return type of the post method is String, then why is it expecting a Reply ?
Note that @Service is required for my yet to be coded get method which will reply JSON.