• Post Reply Bookmark Topic Watch Topic
  • New Topic

Accessor and mutator are getting called more than once  RSS feed

 
Manohar Chhapolia
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

When a JSF screen is getting displayed in my application, Accessor and mutator for a field is getting called more than once.

I am not sure what details to provide that might help you to fix the problem.

Pls let me know if some one has faced similar problem.

Thanks in advance.

Regards,
Manohar
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They're supposed to be called more than once. It's part of the lifecyle stages of JSF.

It's unwise to do any sort of logical processing in accessors or mutators or to make assumptions about when, in what order or how often they will be called. Logical processing should be done either in the constructors, post-constructors (where supported) or in action processors.

In other words, accessors and mutators (setters and getters) should have no side effects.
 
Manohar Chhapolia
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Tim.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!