[Building Sakai] Injection in JSF Managed Bean

Steve Swinsburg steve.swinsburg at gmail.com
Tue Mar 1 13:46:38 PST 2011


Hi,

I would recommend against using JSF. If you are using the App builder, try Wicket or RSF. The injection code is  a lot cleaner in those cases plus the presentation layer is far superior.

cheers,
Steve



On 01/03/2011, at 7:59 PM, 50600822 at stu.hcmut.edu.vn wrote:

> Hi, when I used SakaiAppBuilder to create a JSF HelloWorld, I looked at the faces-config and saw:
>    <managed-bean>
>        <description>Jsfdemo Tool: HelloWorld Bean</description>
>        <managed-bean-name>HelloWorldBean</managed-bean-name>
>        <managed-bean-class>org.sakaiproject.jsfdemo.tool.jsf.HelloWorldBean</managed-bean-class>
>        <managed-bean-scope>session</managed-bean-scope>
>        <managed-property>
>            <description>User Directory Service</description>
>            <property-name>userDirectoryService</property-name>
>            <value>#{org_sakaiproject_user_api_UserDirectoryService}</value>
>        </managed-property>
>    </managed-bean>
> 
> First, I thought org_sakaiproject_user_api_UserDirectoryService was a bean id created by Spring then injected here. But when I looked at the applicationContext.xml , it's empty, no such bean was declared there. I deployed the tool and to my suprise, it worked fine. Can somebody tell me what happened? What kind of context that org_sakaiproject_user_api_UserDirectoryService belongs to ? is it shared across all web app? How did that context was created (I tried but still don't understand how Sakai shared components work <x_x>  )? How do I get a list of beans in that context just in case I want to inject some useful bean like SessionFactory for Hibernate.
> 
> Sorry for asking too much :P
> 
> Thanks in advance.
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
> 
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"



More information about the sakai-dev mailing list