
Originally Posted by
saravanansivaji
Dear friends,
I am new Web Technologies, as well as, Spring. I know basic MVC architecture. I want to know how to handle this situation using Spring
I have a jsp file (home.jsp), with one text field (noOfPerson) and a submit button.
I will give some int value in the text field (noOfPerson)
Once I click the submit button, I have another jsp (getDetails.jsp), which has to be displayed with dynamic set of fields, firstname and lastname
for example, if I enter 2 in noOfPerson, then I have to display getDetails.jsp page dynamically with 2 set of text fields containing the following,
firstname1, surname1
firstname2 surname2
---------------
I have a bean class
class dependent
{
String fristname;
String surname;
//with getters and setters
}
I am using multiactioncontroller, my question is, when I click submit button in home.jsp, the following error was displayed
Neither BindingResult nor plain target object for bean name 'command' available as request attribute
org.springframework.beans.NotReadablePropertyExcep tion: Invalid property 'firstname1' of bean class [domain.Dependent]: Bean property 'firstname1' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
Is this right?
return new ModelAndView("getDetails","command", newCommandObject(Dependent.class));
can this work?
return new ModelAndView("getDetails");
Could anyone tell me how to handle the situation...how to do bind the bean class with the jsp form that have dynamic fields...how to do validation.
or
can I use simply html tags instead of form:form tags?