use annotation in Spring MVC to jump to another action in the action
The return value of the method in action is a string line, and the general case is to return a JSP, such as:
return "XX": it means returning to a JSP page
What if you want to jump to another action in this action?
return "Redirect://.do?"For example:
@RequestMapping (params="Action=delete") PublicString Delete (@RequestParam ("type") intType, @RequestParam ("URL") (String URL) {Map<string, object> policy =NULL; if(Type = =0) { if(logger.isdebugenabled ()) {Logger.debug ("Delete an Access policy"); } Policy= This. Visitorproxymanager.getvisitorpolicies ("Policy"); Policy.remove (URL); if(logger.isdebugenabled ()) {Logger.debug ("Delete Access Policy succeeded"); } return "redirect:/console/visitorpolicylist.do?action=list&type=0"; } Else { if(logger.isdebugenabled ()) {Logger.debug ("Delete Session access policy"); } Policy= This. Visitorproxymanager. Getvisitorpolicies ("Sessionpolicy"); Policy.remove (URL); if(logger.isdebugenabled ()) {Logger.debug ("Delete Session access policy succeeded"); } return "redirect:/console/visitorpolicylist.do?action=list&type=1"; } }
Use annotation in Spring MVC to jump to another action in the action