So when I'm submitting the form its throwing NullPointerException. Is it possible to create index property control with multiple nested beans ?
Is possible then how to do that ?
As I understood about index property and class nesting hierarchy, HTML code should generate like below -
<input type="text" name="bean.ddetails.deptid" >
<input type="text" name="bean.ddetails.deptname" >
<input type="text" name="bean.ddetails.deptloc" >
<input type="text" name="bean.edetails.empid" >
<input type="text" name="bean.edetails.empname" >
<input type="text" name="bean.edetails.emploc" >
So that after submit the form, beans are properly filled from respective text box values.
Sorry ! I've not mentioned the <html:form> tag. My <html:form tag points to the "/employee/PromotionProcess" action.
First I'm showing a form where user enters employee and department data tabular wise, i.e. multiple record at a time can be entered. After submit I'll take those data in an action and store them in
database. But data is not coming after submit. BeanUtility simple fails to map the text box names with the beans properties.
Prithwish Ghosh wrote: But data is not coming after submit.
Firstly, I think, the struts bean extends ActionForm class, which I don't see in your bean/form class.
Have you checked out whether the data is getting stored into Bean, print out this data into your action class, like
Prithwish Ghosh wrote:Thanks Sagar for your help. I've searched out your given links and found some tricky things which gave me a different idea. I've changed my JSP page like below and my problem is solved -
I like your efforts, some people who joined JR just want ready code, but you searched and help yourself and that's the best thing of this forum, Its helps you to learn and engaged in some brainy discussion..