Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Objects within Objects access  RSS feed

 
omkar patkar
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I have two classes with me,



Now if i want to access the "size" property of class B from class A ... then how should i do that in struts ?

any idea ?

Thanks
Omkar Patkar
 
Dileep Kamath
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Struts internally uses beanutils to get/set properties. So you can use the standard way to access attributes of beans, i.e. if "objClassA" is an instance of A in request then you can access size property of B by:

[ March 09, 2007: Message edited by: Dileep Kamath ]
 
omkar patkar
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is this supported in struts 1.2.8 ?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by omkar patkar:
is this supported in struts 1.2.8 ?


Yes. The notation demonstrated by Dileep is supported in all versions of Struts.
 
omkar patkar
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Merill ! ... i will try that now !
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!