I am getting an HTTP Status 404
error in my controller.
@RequestMapping(value="/showMsg/",
method=RequestMethod.GET,produces=
{
"application/json"
})'
public ResponseBody String show(){
HashMap hash = new HashMap();
hash.put("msg", "welcome to spring angular js");
return hash;
}
$http.get('HelloWorld/showMsg').success(function(data){
alert("Success");
}).error(function(data){
alert("Error");
});
I get an HTTP Status 404
error.
URL is wrong in this case.
Define correct URL something like below:
$http.get('http://localhost:8000/HelloWorld/showMsg')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.