About redirection
Under normal circumstances, the controller method returns a value of type string and will be treated as a logical view name
If the returned string is prefixed with forward: or redirect:, SpringMVC will treat them specially: treat forward: and redirect: as indicators, and the following strings are treated as URLs
- redirect:success.jsp: will complete a redirection to success.jsp
- forward:success.jsp: will complete a forwarding operation to success.jsp
E.g:
@RequestMapping(value = "/emp/{id}",method = RequestMethod.DELETE)
public String delete(@PathVariable("id") Integer id){
employeeDao.delete(id);
//return "forward:/emps" ;
return "redirect:/emps" ;
}