l a s
l a s

Reputation: 3923

Spring MVC | requestDispatcher & sendRedirect

Is there a framework provided/specific way where we can do requestDispatcher and sendRedirect similar to simple Java EE MVC applications?

Please suggest the methods.

Upvotes: 4

Views: 4525

Answers (1)

Ramesh Kotha
Ramesh Kotha

Reputation: 8322

you can redirect in spring like this

@RequestMapping(method = RequestMethod.POST)
    public String processForm(ModelMap model) {            
        // process form data

        model.addAttribute("notification", "Successfully did it!");
        return "redirect:/form";
    }

Upvotes: 4

Related Questions