This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Will the setters be called

 
dnyan ginde
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a form bean which has one setter method. This bean is associated with a jsp. Now i define this bean in my struts-config.xml file under the <form-beans></form-beans> tags. I DO NOT use the name attribute of the actions-mapping to associate the bean with my action class. Now my question are:
1) Will the reset,setter methods of the form bean be called?
2) Will the form bean be null in my action class?
 
Anirvan Majumdar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put in the "name" attribute in the corresponding action mapping in your strus-config and put validate="false" and scope="request".

In this case, when you come to your action class for the first time, and you try to retrieve it from the request object, it WILL return NULL.
 
dnyan ginde
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont want to put the name attribute. My question is( given the conditions mentioned in my above post )
1) Will the setters be called?
2) Will the form bean be null in the action?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by dnyan ginde:
1) Will the setters be called?
2) Will the form bean be null in the action?


1) No
2) Yes
 
dnyan ginde
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Merill
 
dnyan ginde
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Merill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic