aspose file tools
The moose likes JSF and the fly likes Controller related question Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Controller related question" Watch "Controller related question" New topic
Author

Controller related question

S Majumder
Ranch Hand

Joined: Jun 03, 2009
Posts: 241
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
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14480
    
    7

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.
S Majumder
Ranch Hand

Joined: Jun 03, 2009
Posts: 241
Hi Tim Holloway ,

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


regards,
S

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14480
    
    7

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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Controller related question
 
Similar Threads
"JSF compliant" diagram for component diragam
Controller servlet gets messy
Questions regarding BaseController and other controllers
Some questions regarding part II
managed -and backing beans question.