I assume you want to construct a Bean (within the servlet) and store it in some context (application, session or request) and then have a JSF-page access it using the "normal" JSF-expression language. If that is the correct interpretation of your question, then th answer is YES.
Configure the bean in jsf's faces-config.xml. The bean-name and the context are crucial.
The servlet can instantiate the bean and store it in the context using the configured bean-name.
That's exactly what I was looking for! Excelent. I'm trying to integrate JSF in an already existant webapp that uses an adapted version of the Command and Controller pattern. How would I go about doing what you described?
Joined: Mar 17, 2004
Bruce: You do not need the faces-config.xml for this.
If you want to add a JavaBean to the session context: - create the bean (should be obvious)
- add it to the session:
Now to access it in your JSF-files: - add the bean-definition to faces-config.xml
- use it:
to use application context, you define "application" in the faces-config scope-attribute and use to put the bean into the application context.
Obviously using the corresponding get-methods you could access the beans that were created using JSF-factories also from your servlets.
hope this helps Alexander
Joined: Jul 15, 2005
Oh! Didn't realize it was that simple. A HUGE 'Thank You!'