• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

about logic:iterate and bean:write tag

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using logic iterate tag to loop around a collection and using bean write tag to present the data.

the logic:iterate iterates a collection 'mycollection', which contains objects of mybean class.

In 'mybean' class i have three string objects which are presented through bean:write

logic:iterate name = myform property = mycollection id=mycollection
bean:write name=mycollection property=string1
bean:write name=mycollection property=string2
bean:write name=mycollection property=string3
/logic:iterate

this part of my JSP works very fine.
after using the bean:write tag, which reads the data from 'mybean' class
and after end of logic:iterate tag, when i try to point to a property of myform again, i get an exception- no getter method for property...

like
after the logic iterate tag when i write
html:hidden name=myform property=mystring
i get the exception.

my string property is present in my ActionForm and not specified in MyBean class. In this case i get the Exception. If i use the same tag before using bean:Write tag then it is working fine.

i dont know whether this is because of bean:write or logic:iterate tag, where i point to a collection which contains object of some other class.

why is this exception coming?help me.

regards
Surendar.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the tag is correctly coded it will work either before or after the <logic:iterate>, so there has to be something wrong with the tag or the corresponding ActionForm bean.

If you want help debugging it, please show us:
  • The full text of the exception
  • Relevant portions of your struts-config.xml file
  • Relevant portions of your JSP file, including the <html:form> tag
  • Relevant portions of your ActionForm class

  • ;
    [ October 27, 2006: Message edited by: Merrill Higginson ]
     
    surendar prabu
    Ranch Hand
    Posts: 102
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Merill,
    Yes, its working fine. I made some mistake in naming the beanclass which is referred by the Id attribute. given the same name to Id attribute and name attribute in logic:iterate tag. I have changed id attribute and its working fine.
     
    reply
      Bookmark Topic Watch Topic
    • New Topic