Re: Why doesnt logic:iterate use the formBean from the html:form

2002-11-16 Thread Arron Bates
  html:form action=/helpMe
 logic:iterate property=infoItems
 
/logic:iterate
  /html:form
 
  I assumed that iterate tag would look for a property infoItems on the
  formBean for the html:form
 
  But it doesnt?

The nested tags work in exactly this fashion, picking up on the form
bean and then having all the name attributes more or less taken care of
as you've asked.

And as martin says, assumptions shouldn't be made about the html/form
nature, so if you find yourself wanting to make WML, there's a
nested:root tag you can use to point at an arbitrary bean reference.


There's docco on the nested tags on the Struts site, but there's a
primer and a tutorial to get you started on...

http://www.keyboardmonkey.com/next

...I'm quite sure you'll find them a good fit.



Arron.


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Why doesnt logic:iterate use the formBean from the html:form

2002-11-15 Thread Martin Cooper


On Thu, 14 Nov 2002 [EMAIL PROTECTED] wrote:




 html:form action=/helpMe
logic:iterate property=infoItems

   /logic:iterate
 /html:form

 I assumed that iterate tag would look for a property infoItems on the
 formBean for the html:form

 But it doesnt?

No, it doesn't. You are assuming that JSP pages are only used to generate
HTML, which is an invalid assumption. If I want to use JSP to create, for
example, WML pages, I should still be able to use the Struts logic tags to
do so. If the logic tags made assumptions about the existence of HTML
tags, I would not be able to do that.

--
Martin Cooper



 If the name attribute is required then shouldnt it complain against
 the TLD?

 Rather you have to specify:

 logic:iterate name=compressedInfoForm property=infoItems
 .

 Now ofcourse I dont like this since now I have this string
 compressedInfoForm that has
 been defined in the struts-config.xml and if I change it there I have to
 remember to change
 it everywhere.

 Is there a better mechanism to get the name of the formBean without
 hardcoding?

 -Shakeel




 --
 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]




Why doesnt logic:iterate use the formBean from the html:form

2002-11-14 Thread shakeel . mahate



html:form action=/helpMe
   logic:iterate property=infoItems

  /logic:iterate
/html:form

I assumed that iterate tag would look for a property infoItems on the
formBean for the html:form

But it doesnt?

If the name attribute is required then shouldnt it complain against
the TLD?

Rather you have to specify:

logic:iterate name=compressedInfoForm property=infoItems
.

Now ofcourse I dont like this since now I have this string
compressedInfoForm that has
been defined in the struts-config.xml and if I change it there I have to
remember to change
it everywhere.

Is there a better mechanism to get the name of the formBean without
hardcoding?

-Shakeel




--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org