I worked on this same issue and I am sure I have found out the exact reason for it.
Neither BindingResult nor plain target object for bean name 'command' available as request attribute
If your successView property value (name of jsp page) is the same as your input page name, then second value of ModelAndView constructor must be match with the commandName of the input page.
E.g.
index.jsp
<html>
<body>
<table>
<tr><td><a href="Login.html">Login</a></td></tr>
</table>
</body>
</html>
dispatcher-servlet.xml
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/jsp/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<bean id="urlMapping"
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="urlMap">
<map>
<entry key="/Login.html">
<ref bean="userController"/>
</entry>
</map>
</property>
</bean>
<bean id="userController" class="controller.AddCountryFormController">
<property name="commandName"><value>country</value></property>
<property name="commandClass"><value>controller.Country</value></property>
<property name="formView"><value>countryForm</value></property>
<property name="successView"><value>countryForm</value></property>
</bean>
AddCountryFormController.java
package controller;
import javax.servlet.http.*;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.validation.BindException;
import org.springframework.web.servlet.mvc.SimpleFormController;
public class AddCountryFormController extends SimpleFormController
{
public AddCountryFormController(){
setCommandName("Country.class");
}
protected ModelAndView onSubmit(HttpServletRequest request,HttpServletResponse response,Object command,BindException errors){
Country country=(Country)command;
System.out.println("calling onsubmit method !!!!!");
return new ModelAndView(getSuccessView(),"country",country);
}
}
Country.java
package controller;
public class Country
{
private String countryName;
public void setCountryName(String value){
countryName=value;
}
public String getCountryName(){
return countryName;
}
}
countryForm.jsp
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html>
<body>
<form:form commandName="country" method="POST" >
<table>
<tr><td><form:input path="countryName"/></td></tr>
<tr><td><input type="submit" value="Save"/></td></tr>
</table>
</form:form>
</body>
<html>
Input page commandName="country"
ModelAndView Constructor as return new ModelAndView(getSuccessView(),"country",country);
Means inputpage commandName==ModeAndView(,"commandName",)