Saturday, 24 August 2013

@RequestMapping in spring not working

@RequestMapping in spring not working

I am new in spring mvc.I created one controller newController.java in
springproject.My code is below:
@RequestMapping(value = "/Receiver", method = RequestMethod.GET)
public String recvHttpGet(Model model) {
System.out.println("here get");
}
@RequestMapping(value = "/Receiver", method = RequestMethod.POST)
public String recvHttpPost(Model model) {
System.out.println("here post");
}
@RequestMapping(value = "/", method = RequestMethod.GET)
public String show(Model model) {
return "index";
}
whenever I tried to run it using normally then index.jsp page is show but
whenever i tried to call /Receiver url it shows 404 error.Please help
me.Also whenever i changed in recvHttpGet method return "index" it also
shows 404 error.Also nothing to be written in console.

No comments:

Post a Comment