• 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

Question about sequence of calls to a Bean with request scope?

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a question about the sequence of calls to a Bean in a JSF application.

I have a simple search page with a field and a search button.

The search bean, with request scope, looks like this:

Now when the search page is displayed a new Search bean (I will call it Search1) is instatinated. Then the Search1.getName is called and the page is displayed.

When I press the Search button a new instance of a Search bean (Search2) is instatinated. Then
Search2.getName() is called.
Search2.setName() is called.
Search2.doSearch() is called.

Does anybody know why is Search2.getName() called?
The newly constructed bean can not return a correct value. The value is in Search1. Is there a reason for Search2.getName() to be called?

I have debugged this on glassfish 2, if that matters.

Thanks in advance.
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It happens during validations phase. It needs the initial value to check if it is different from the submitted value.
 
kiril mitov
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic