Guest User

Untitled

a guest
Jun 24th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. @RequestMapping({"/someurl"})
  2. public ModelAndView execute(Model model) {
  3. if (someCondition) {
  4. //forward to controller A
  5. } else {
  6. //forward to controller B
  7. }
  8. }
  9.  
  10. @RequestMapping({"/someurl"})
  11. public String execute(Model model) {
  12. if (someCondition) {
  13. return "forward:/someUrlA";
  14. } else {
  15. return "forward:/someUrlB";
  16. }
  17. }
  18.  
  19. RedirectView redirectView = new RedirectView("/controllerRequestMapping/methodmapping.do", true);
Add Comment
Please, Sign In to add comment