Erro: Cannot invoke method talk() on null object
09/03/2013 02:27
import Bot.*
class ChatController {
def index = {
session["conversation"] = new Bot()
}
def processAnswer = {
try {
render(contentType: "text/json") {
chat(status: "ok", response: session["conversation"].talk(params.question))
}
} catch (Exception ex) {
println ex.getMessage()
render(contentType: "text/json") {
chat(status: "error")
}
}
}
}
private static final BotMother mother = new BotMother();
public String talk(String s) throws Exception {
AliceBot bot = mother.newInstance();
System.out.println(s);
return bot.respond(s);
}
Para se registrar, clique aqui.