2010-12-07 10 views
2

Google App Engineでこれ(SomeActionBean.javaの追加メソッド)が動作しない理由を知らないのですか? Localyは完璧に動作します。ソリューションを探す場所は何ですか? Stringは比較Stripes、GAE:他のメソッド処理(POST)を実装する方法

/** 
* @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; 
} 
+0

あなたが得るエラーは何ですか?:Javaの文字列はプリミティブではありません

request.getMethod() == "POST" 

ので、彼らはで比較すべき equalsメソッドをあなたはスタックトレースを投稿できますか? – Kdeveloper

+0

ちょっと分かりました。そのifと==の問題は比較します。あなたが答えを書くなら、私はそれを受け入れるだろう、Kdeveloper、コメントのおかげで、 – Solata

答えて

3

は間違っている:

"POST".equals(request.getMethod()) 
関連する問題