rajputhch
rajputhch

Reputation: 627

How to do annotation based RequestMapping

I am calling spring controller from ajax like /test/new.ui. How to do RequestMapping in controller method.

Thanks in Advance.

Regards, Raju

Upvotes: 0

Views: 441

Answers (1)

Joe
Joe

Reputation: 1023

@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
    }
}

Upvotes: 1

Related Questions