-
1. Re: Need to get request parameters in JSF Portlet
antoine_h Feb 11, 2009 1:00 PM (in response to chancey)look at the samples and how the administration of the portal is programmed.
you can get it through some specific variables that are declared by the portal, for use in the JSF, that is in EL expression.
look in the file :
deploy\jboss-portal.sar\portal-admin.sar\portal-admin.war\WEB-INF\faces-config.xml
you'll find there the jsf variable resolver, that provides the variables to get portal informations inside the JSF.
and look at the portal administration pages.
with files like : deploy\jboss-portal.sar\portal-admin.sar\portal-admin.war\WEB-INF\jsf\editContext.xhtml
and code like :<c:when test="#{portalobjectmgr.selectedObject.type == PortalObject.TYPE_CONTEXT}">#{bundle.PORTALS_NO_CAP}</c:when>
I don't remember exactly but I think you can get what you want this way.
for the Get parameter... I am not sure...
but may be you can make something similar, with a resolver that provide the request param.
the best would be to see how the portlet request parameter is "transfered" to the JSF context.
- do you use of the JBoss Portlet Bridge ? or another bridge for using some JSF in a portlet ?
- in JSF, did you looked at the ExternalContext to get the context ? ... may be they are yet there...
hope it helps, -
2. Re: Need to get request parameters in JSF Portlet
chancey Feb 12, 2009 7:01 AM (in response to chancey)Thank you Antoine_h. I'll try to do your way as soon as I can.
I'm using jboss portletbridge B6 and jsf-facelets-1.1.15.B1
I've also found some example showing how to get PortalNode object in
JSF portlet. It looks like this:// Get render request object that contains needed info JBossRenderRequest req = (JBossRenderRequest) FacesContext.getCurrentInstance() .getExternalContext().getRequest(); // Extract window name for this portlet String windowName = req.getPortalNode().getName();
It seems tobe just what I need, but the problem is that I can't get FacesContext object. As I understand it is described in jsf-api libray. But when I'm trying to deploy my portlet together with portletbridge and jsf-api library, I'm getting error:
Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener
com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! org.jboss.portletbridge.context.FacesContextFactoryImpl
May be I'm doing somthing wrong? Or are there any other ways to solve the problem using jsfportletbridge? -
3. Re: Need to get request parameters in JSF Portlet
wesleyhales Feb 12, 2009 8:20 AM (in response to chancey)Get rid of JSF libs in you web-inf/lib and use the default ones in JBoss app server.
-
4. Re: Need to get request parameters in JSF Portlet
chancey Feb 12, 2009 10:16 AM (in response to chancey)"wesleyhales" wrote:
Get rid of JSF libs in you web-inf/lib and use the default ones in JBoss app server.
What do you mean "default"? Should I put jsf-api library in server/default/lib folder to use it as a default library? Or are there any jsf libraries implemented in JBoss app server