HTTP Status 500 Error

Source: Internet
Author: User
HTTP Status 500-java.lang.illegalstateexception:neither Bindingresult nor plain target object for Bean name ' Comman d ' available as request attribute error: an attribute with no command in the request field
<form:input path= "LastName"/> To display a page, you must have a Bean,bean in the domain object that corresponds to the form path.
<form:form action= "emp" method= "POST" modelattribute= "Employee" >

@RequestMapping (value = "/emp", method=requestmethod.get) public
String input (map<string,object> Map) {
map.put ("department", Departmentdao.getdepartments ());
Map.put ("Employee", new employee ());
return "input";
}
Workaround: Specify the data model principle of the binding through the Modelattribute property: If this property is not specified, the default form bean that reads command from the request domain object, that is, the default modelattribute is the command If the property value does not exist, an error occurs SPRINGMVC that the form must be echoed, even if it is the first time to request the domain to find the bean to match the current form value, even if it does not need to echo

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.