2011-01-20 12 views
0

私は、/test/new.uiのようなajaxからスプリングコントローラを呼び出しています。コントローラメソッドでRequestMappingを実行する方法。注釈ベースのリクエストマッピングを行う方法

ありがとうございました。

よろしく、 ラジュあなたがドキュメントを読ん

+3

は、あなたはそれを動作させることができない場合は、ここに戻ってきて、それを試してみると、私たちがお手伝いさせていただきます。 – skaffman

+0

http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-ann-requestmapping –

+0

Keith DonaldはSpringMVCとajaxの使い方に関する良いブログを書いています。 http://blog.springsource.com/2010/01/25/ajax-simplifications-in-spring-3-0/ –

答えて

1
@Controller 
@RequestMapping("/test/") //This is optional to separate the /test/ part from the new.ui if you want to do other urls under the /test/ 
public class SomeController { 

    @RequestMapping("new.ui") //You can also do the entire url fragment here "/test/new.ui" 
    public Object handleNewMethod(/* ModelAttributes, Errors, RequestParams here */) { 
     // Code here 
    } 
} 
関連する問題