Question

I'm getting a 405 error from my Spring 3.2 MVC form. It's telling me POST is not supported, but both my form and controller method use it. Here is the relevant portion of my form.

<form:form commandName="bulletin" method="post" value="/processBulletin">

Here is the relevant portion of my controller.

@RequestMapping(value = "/processBulletin", method = RequestMethod.POST)
    public String processBulletin(
            @ModelAttribute("bulletin") Bulletin bulletin, Model model,
            BindingResult result)
Was it helpful?

Solution

You don't specify an action in the form so it's likely trying to post to the same URL on which the form is rendered.

The documentation makes no mention of a value attribute.

In your form change value to action and see if that does the trick for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top