woking with struts + hibernate
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   khushi_Iyer
Posted On:   Sunday, April 8, 2007 02:37 AM

Hi i am working with struts and hibernate currently....and i am facing a problem....

I hav a JSP in which according to the no. of entries in the DB , number of textboxes are generated dynamically using logic:iterate(it iterates "List's Length" no. of times)......I have successfully retrived the data from the DB and displayed on the JSP....but the USER of the system may wish to EDIT and REINSERT it in DB...but since they are dynamically generated...there are no getters and setters for them in the ACTION FORM....what should i do for insertion..........


can anybody suggest any idea for this problem....please help me!!!!!!

Re: woking with struts + hibernate

Posted By:   Glenn_Wilson  
Posted On:   Friday, April 13, 2007 07:11 PM

Not sure I understand your question but here goes....

If you are using Hibernate to pull your data out dynamically you should have a collection of hibernate object which you are dynamically displaying on the screen via a JSP and logic:iterate tags.

You are likely setup with a form object that contains the collection of hibernate collection.

if you diplay your collection as editable fields (i.e. ) then when the user edits that data it will be submited back to your form and your hibernate collection will be updated in memory.

The action should just start a hibernate transaction and save the collection back to the DB.

Re: woking with struts + hibernate

Posted By:   Anonymous  
Posted On:   Monday, April 9, 2007 01:12 AM

struts provides the facility for populating and setting multi form data. search for multi form with struts
About | Sitemap | Contact