【发布时间】:2010-12-07 13:23:26
【问题描述】:
不知道为什么这个(来自 SomeActionBean.java 的附加方法)在 Google 应用引擎上不起作用? Localy 一切运行完美。知道在哪里寻找解决方案吗?
/**
* @return Page to display, filled with correct data
*/
@DefaultHandler
public Resolution welcome() {
Resolution fd = new ForwardResolution(VIEW);
HttpServletRequest request = this.ctx.getRequest();
if(request.getMethod() == "POST") {
String content = getRequestContent(request);
updateData(content);
}else if (request.getMethod() == "GET"){
String ct = request.getContentType();
if(("application/json").equals(ct))
try {
getNotesJson(); //fill returnJson global variable
fd = new JSONResolution(returnJson);
//TODO Spread to other entities
} catch (JSONException e) {
e.printStackTrace();
}
}
return fd;
}
【问题讨论】:
-
你得到什么错误?你可以发布堆栈跟踪吗?
-
刚刚想通了。它是 if 和 == 比较中的问题。 Kdeveloper,感谢您的评论,如果您写答案,我会接受。
标签: json google-app-engine methods http-post stripes