Hi Jose,
thanks for your response. Actually you can split my post in 2. - In the first part, I ask how to use Struts 1.0.X in order to implement ActionForms that could match HTML forms with a number of parameters known at runtime. I have solved the problem for checkboxes, by defining a parameter of type String[] in ActionForm with its get/set methods. The JSP checkboxes could be something like: <html:checkbox property="mycheckbox" value="on1"/> <html:checkbox property="mycheckbox" value="on2"/> <html:checkbox property="mycheckbox" value="on3"/> ....` In that way I am able, in validate() method of ActionForm, to get [on1, on2, on3...] (supposing all of them are checked by user). I mean, I am able to distinguish in the String[] which on* belong to which JSP <html:checkbox>. To write on1, on2 and on3 in HTML page source I fall again in the problem of not been able to embed custom tags but that is a minor problem. (I want to avoid scriplets in JSPs). My intend is to extend previous for <html:text> and other struts tags, but, I can not figure it out, specially <html:text>. I intend to do it without upgrading to Struts 1.1. Anyone with ideas about how to get inputs from several <html:inputs>, radiobuttons, etc is very welcome. - Second point is more an suggestion, or at least, to get info why it has not been posted before. The idea is to enable Struts to work out ActionForms itself, specially suitable for that I meant before, JSP forms obtained at runtime, as a consequence of results of a database query, by instance. I would like to know why DynaBeans, could not be applied for it. Another idea, as someone posted before is using BCEL from Jakarta, but I agree that it is really really cool. However, if I missuderstood something or I am in some mistake, any correction would be really really appreciated. Adolfo. >From: Struts Newsgroup (@Basebeans.com) <[EMAIL PROTECTED]> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> >To: [EMAIL PROTECTED] >Subject: Re: variable number of parameters in forms known at runtime >Date: Mon, 6 May 2002 12:25:01 -0700 > >Subject: Re: variable number of parameters in forms known at runtime >From: Jose Quinteiro <[EMAIL PROTECTED]> > === >If I understand you correctly, you need to generate Java interfaces at run >time. I believe this is possible. This article makes it sound like it's >possible: >http://java.sun.com/products/jfc/tsc/articles/generic-listener/index.html >(Look at the end, where he talks about John Rose.) > >You could then use the Dynamic Proxy API to implement these interfaces. >This article introduces the API: >http://java.sun.com/products/jfc/tsc/articles/generic-listener2/ > >I've used the Dynamic Proxy API - it's cool, but can be confusing. > >I've never tried to generate Java classes or interfaces at run-time, but >it sounds like a cool project. > >On Mon, 06 May 2002 08:46:19 -0700, Adolfo Miguelez wrote: > > > Hi All, > > > > this is probably an ancient problem but I could not find any satisfying > > solution browsin the forum. It seems to be a problem with catching of > > input POST parameters in ActionForms linked to forms with variable input > > parameters. > > > > We are using Struts 1.0.x and for the moment we do not what to upgrade > > Struts 1.1. Please take in mind this point for the response. > > > > * First question, of course, is there any elegant solution for > > implementing such an ActionForm so it can pick up the undetermined > > number of parameters and how to handle them? > > > > * As a workaround I figure out a solution that I have seen neither > > implement nor propossed at all, so I just wonder why: Would not be > > possible, taking advantage of Yakarta/Commons DynaBeans, to create the > > form beans on request, so they can auto-create, at runtime a parameter > > and get/set method for each input parameter received in the request. > > > > AFAIK, DynaBeans are used to parse XML defined forms in struts-config. > > However this does not solve our problems since we do not know the input > > params at development or deployment time. Would not it be a proper > > enhancement for handling forms with a number a name of parameters known > > at runtime. > > > > Sorry if I am missing some points here, that I am afraid that so. > > > > Adolfo. > > > > > > > > > > > > _________________________________________________________________ MSN > > Photos is the easiest way to share and print your photos: > > http://photos.msn.com/support/worldwide.aspx > > > > > > -- > > To unsubscribe, e-mail: > > <mailto:[EMAIL PROTECTED]> For additional > > commands, e-mail: <mailto:[EMAIL PROTECTED]> > >-- >To unsubscribe, e-mail: ><mailto:[EMAIL PROTECTED]> >For additional commands, e-mail: ><mailto:[EMAIL PROTECTED]> > _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

