insert into database from struts
hi i m new to struts. also i have started to develop struts framework based applications.
now actually my requirement is that i have to insert into database from many jsp pages.
how to achieve this.
for example i have employee master from where i ll insert/add new employee,
next purchase master from where i ll insert/add new purchase details,
at last sales master from where i ll insert/add new sales details
i can do this by having three separate class for inserting into three different tables,
but my requirement is that i should use a common class or jsp page to insert data from many number of pages.
please provide me any tutorial/link from where can i learn about this and implement it.
thanks and regards
Surya
Re: insert into database from struts
Hello,
try this.....
create three class for three pages
employee
purchase
sales
now create one common EmployeeDetails.java class which has a object of this three class employee,purchase and sales
now before you load first page employee detail create object of EmployeeDetails class and put this object in session.
before u navigate next page submit this details to server and set this employee details to session variable and again put this
object to session. again before u navigate last page sales set again all purchase details in this session variable
last when u submit last page then you have both pages detail employee and purchase in session