Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Controller related question  RSS feed

 
S Majumder
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • 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
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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
  • 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
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!