Why Spring REST do not analyze "get","post" methods with same url -


i using spring rest , have 2 methods

@requestmapping(value="/",method = requestmethod.post)     public @responsebody     object test1(httpservletrequest request) {}  @requestmapping(value="/",method = requestmethod.get)     public @responsebody     object test2(httpservletrequest request) {} 

but not able detect 2 methods. necessary url should different each http method in spring.

spring can support , post same url. i've done many times. example (this post , put, it's same difference):

@controller @requestmapping(value="player") public class playercontroller {      @autowired     private playerservice playerservice;      @requestmapping(method = requestmethod.post)     @responsebody     public player createnewplayer(@requestbody player player) {         return playerservice.createnewplayer(player);     }      @requestmapping(method = requestmethod.put)     @responsebody     public player updateplayer(@requestbody player player) {         return playerservice.updateplayer(player);     } } 

if can post error message you're getting, maybe can figure out what's wrong.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -