Hi, I am new to Struts and desiging a web application. I have problem designing ActionForm bean for one of my JSP form. The problem is, Attributes Name of the JSP form is dynamic, It comes form session of previous pages. So, How do I create ActionForm for my dynamic page? Any help? thanks ~kumar
I'm not sure exactly how dynamic the content of your secondary form is, but it seems to me that you should probably have multiple beans with multiple pages. i.e. currently you're trying to do this: form 1 --> action --> problem form where what you really want to do is form 1 --> action --> form 2a || 2b || 2c based on the input from form 1. This is the cleanest and most easily maintainable design. The other (and much less preferred) option is to design a form bean with all possible input fields. But this is very difficult for someone else to read and understand.
"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The JavaPerformanceTuning.com team, Newsletter 039.
Hi David, Thanks for reply. But, I have problem defining get/set method for my FormBean cause, Application can only know the HTML Textfield (or Option List) name during runtime. ( I have a Hastable object in my session that have field name and value..and I render HTML (or JSP) using this name and value (if value is String I create HTML TextField and if Vector I create Option List.)) Pls ask if you did,nt get the problem..I think I am not good at explaining my problem. thanks ~kumar