• 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

Controller related question

 
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi every body ,
I want to know , how to create a controller in jsf ?
Can I create multiple backing beans & keep references of my all backing-beans in controller ?
Also how could I make changes in my faces-config.xml accordingly?


Thanks ,
S
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSF controllers are based on the MVC Controller architecture, with the one exception that unlike true MVC, JSF controllers cannot reflect changes in the Model back to the View asynchronously, since HTTP forbids unsolicited posting to the client.

The controller logic is inside the JSF servlet and inside the various JSF tags. If you wanted to, you could create your own custom JSF tags with their own controller logic in them, but it's not a simple task.

Controllers are designed to be sharable objects, so you don't "store backing beans" inside them. Instead, the JSF framework manages the binding of the Model, View and Controller components (Backing Bean, JSF View page, and JSF tag). This allows the same controller to be used with multiple model/view pairs. Which is important for things like the inputText tag, since it means only one controller instance for the entire view instead of one per input text control. That reduces the overall memory requirements of the webapp - especially when large numbers of users are involved.
 
S Majumder
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim Holloway ,

Thanks for your reply.
Could you prefer any good PDF , for reading / any good site ?


regards,
S

 
Tim Holloway
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use Kito Mann's book (JSF in Action). He outlines the process of creating custom tags. It helps a little if you already know how to build ordinary custom JSP tags which in turn requires a good understanding of JavaBeans.

There's a lot of stuff that has to be put together just right for custom JSF tags, however. It's not the kind of task to be undertaken lightly.
 
reply
    Bookmark Topic Watch Topic
  • New Topic