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?
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.
Customer surveys are for companies who didn't pay proper attention to begin with.
Joined: Jun 03, 2009
Hi Tim Holloway ,
Thanks for your reply.
Could you prefer any good PDF , for reading / any good site ?
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.