Re: dynamic form properties
Hi, Mark, How can I keep a form bean in a session scope? In addition how can I access a form bean from a jsp page directly, instead of using the jsp tags? Thanks, Daka - Original Message - From: Galbreath, Mark [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, June 06, 2002 5:58 AM Subject: RE: dynamic form properties What do you want to know? I use maps and collections in form beans now to capture multi-select list key-value pairs and checkbox array booleans, respectively. I think it would be a simple extrapolation to map key-values for an entire HTML form, permitting a single action form to capture states for every HTML form in the application if the form bean is kept in session scope with an empty reset(). Mark -Original Message- From: Zhihua Xu [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 2:10 AM In Struts 1.1 beta, a Map can be used instead of individual properties on an ActionForm. In the future, I foresee Struts developers using the same base ActionForm in all their projects, without going through the hassle of defining all these String properites. Does anyone have an example of the above usage? Thanks, Daka -- 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]
RE: dynamic form properties
1. Declare the bean's scope as session as an attribute of the form-bean declaration in struts-config.xml and provide an empty reset() method in the bean class; 2. Use java scriplets (though I do not recommend this) as in % List myBean = (List) session.getAttribute( myBean); Iterator i = myBean.iterator(); while( i.hasNext()) { out.println( td + i.next().toString() + /td); } % Goot Morgdah, Mark -Original Message- From: Zhihua Xu [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 25, 2002 2:38 PM Hi, Mark, How can I keep a form bean in a session scope? In addition how can I access a form bean from a jsp page directly, instead of using the jsp tags? Thanks, Daka -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: dynamic form properties
Mark, My scenario is a database application where the number of properties and the actual property labels, which will be used in an entry form, can only be determined at run time. How can I get the number of properties and the corresponding property labels to the jsp and the form bean? Thanks, Daka - Original Message - From: Galbreath, Mark [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, June 06, 2002 5:58 AM Subject: RE: dynamic form properties What do you want to know? I use maps and collections in form beans now to capture multi-select list key-value pairs and checkbox array booleans, respectively. I think it would be a simple extrapolation to map key-values for an entire HTML form, permitting a single action form to capture states for every HTML form in the application if the form bean is kept in session scope with an empty reset(). Mark -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: dynamic form properties
What do you want to know? I use maps and collections in form beans now to capture multi-select list key-value pairs and checkbox array booleans, respectively. I think it would be a simple extrapolation to map key-values for an entire HTML form, permitting a single action form to capture states for every HTML form in the application if the form bean is kept in session scope with an empty reset(). Mark -Original Message- From: Zhihua Xu [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 2:10 AM In Struts 1.1 beta, a Map can be used instead of individual properties on an ActionForm. In the future, I foresee Struts developers using the same base ActionForm in all their projects, without going through the hassle of defining all these String properites. Does anyone have an example of the above usage? Thanks, Daka -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: dynamic form properties
Are you talking about the DynaActionForm? James Mitchell Software Engineer\Struts Evangelist Struts-Atlanta, the Open Minded Developer Network http://struts-atlanta.open-tools.org ICQ: 27651409 AOLIM: jmitchtx (and NO I dont use AOL;) -Original Message- From: Zhihua Xu [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 2:10 AM To: [EMAIL PROTECTED] Subject: dynamic form properties Hi, there, I have learned the following, In Struts 1.1 beta, a Map can be used instead of individual properties on an ActionForm. In the future, I foresee Struts developers using the same base ActionForm in all their projects, without going through the hassle of defining all these String properites. Does anyone have an example of the above usage? Thanks, Daka -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]