I have just read some pieces of the code of the management portlet. As it is a JSF application, I decided to take a look at the faces-config.xml. As far as I can see, the objects I should use to create/remove instances,windows,pages are saved in the session and the application scope.
As my portlet is a simple JSR168 portlet, how can I access the ServletContext from within the PortletContext and how can I access the ServletSession from within the PortletSession ? The JSR-168 states that "The PortletContext must offer access to the same set of resources the
ServletContext exposes", but I cannot see in it, any of the objects exposed in the faces-config.xml.
For example, in the faces-config.xml, in the configuration of the InstanceManagerBean, it is written that the value of the InstanceContainer variable of the application scope is injected into the bean.
Nonetheless, when I try to access the InstanceContainer directly, using the PortletContext, I can´t find it. In fact, I don´t find any of the variables listed in the faces-config.xml.
What might be wrong in my application ?
Does Anyone know or have an example how I can access those variables inside a Portlet ?
You can look at the management portlet.
Can I create this portlet just using the JSR168 API, without using JSF ? Is there any dependence on the use of JSF ?