Foren
How to get portlet request in jsf2 portlet
Hi
Can any one please explain me how to get portlet request in jsf2 portlet.
My Jsf portlet has PortletFaces Bridge and mojarra jars.
Portlet request class is only found on portlet jars(porlet 2.0 for example which i have not used in my project).
But to match the jsf lifecycle with portlet life cycle we are using some sort of bridge(here iam using PortletFaces Bridge) In this case there is no necessity of having portlet 2.0 jars inside the project. If this is the case how to get portlet request.
Please correct me if iam wrong in asking the question.
The overall concept that i have understood is to use any frame work in portlet is we need a bridge that matches with that lifecycle of framework.
Thanks
Phani
Can any one please explain me how to get portlet request in jsf2 portlet.
My Jsf portlet has PortletFaces Bridge and mojarra jars.
Portlet request class is only found on portlet jars(porlet 2.0 for example which i have not used in my project).
But to match the jsf lifecycle with portlet life cycle we are using some sort of bridge(here iam using PortletFaces Bridge) In this case there is no necessity of having portlet 2.0 jars inside the project. If this is the case how to get portlet request.
Please correct me if iam wrong in asking the question.
The overall concept that i have understood is to use any frame work in portlet is we need a bridge that matches with that lifecycle of framework.
Thanks
Phani
Neil Griffin, geändert vor 12 Jahren.
RE: How to get portlet request in jsf2 portlet
Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste BeiträgeFacesContext facesContext = FacesContext.getCurrentInstance();
PortletRequest portletRequest = (PortletRequest) facesContext.getExternalContext().getRequest();
PortletFaces Community Member, geändert vor 12 Jahren.
RE: How to get portlet request in jsf2 portlet
Regular Member Beiträge: 199 Beitrittsdatum: 03.04.12 Neueste Beiträge
Hi Neil
Thanks for the reply
My doubt is like PortletRequest class is present in portlet 2.0 jar
can i use jars like
jsf2 jars+portletfaces2 jar+portlet2.0jars
In one portlet project?
I have tried keeping this combination of jars in one portlet project
while deploying iam getting these error it is not deployed.
04:52:28,901 ERROR [HotDeployUtil:112] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for elearning_portlet
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for elearning_portlet
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:45)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:104)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:109)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:182)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:38)
at com.liferay.portal.kernel.servlet.PortletContextListener.doPortalInit(PortletContextListener.java:99)
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:52)
at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:50)
at com.liferay.portal.kernel.servlet.PortletContextListener.contextInitialized(PortletContextListener.java:55)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException: org.portletfaces.bridge.GenericFacesPortlet cannot be cast to javax.portlet.Portlet
at com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:123)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.initPortlet(PortletHotDeployListener.java:456)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:253)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:101)
... 19 more
Correct me if iam wrong
Thanks & Regards
Phani
Thanks for the reply
My doubt is like PortletRequest class is present in portlet 2.0 jar
can i use jars like
jsf2 jars+portletfaces2 jar+portlet2.0jars
In one portlet project?
I have tried keeping this combination of jars in one portlet project
while deploying iam getting these error it is not deployed.
04:52:28,901 ERROR [HotDeployUtil:112] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for elearning_portlet
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for elearning_portlet
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:45)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:104)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:109)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:182)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:38)
at com.liferay.portal.kernel.servlet.PortletContextListener.doPortalInit(PortletContextListener.java:99)
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:52)
at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:50)
at com.liferay.portal.kernel.servlet.PortletContextListener.contextInitialized(PortletContextListener.java:55)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException: org.portletfaces.bridge.GenericFacesPortlet cannot be cast to javax.portlet.Portlet
at com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:123)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.initPortlet(PortletHotDeployListener.java:456)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:253)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:101)
... 19 more
Correct me if iam wrong
Thanks & Regards
Phani
Neil Griffin, geändert vor 12 Jahren.
RE: How to get portlet request in jsf2 portlet
Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
The portlet.jar depenency is provided by Liferay in the Servlet Container (i.e. Tomcat) or application server (i.e. GlassFish) global classpath. For Tomcat, it's found in tomcat/lib/ext/portlet.jar
So that's probably why you're getting the exception. So if you need to access objects like PortletRequest then portlet.jar must be a compile-time dependency, but must not be included in your portlet WAR/WEB-INF/lib directory.
With Maven, this can be accomplished with scope=provided, such as the following dependency in pom.xml:
So that's probably why you're getting the exception. So if you need to access objects like PortletRequest then portlet.jar must be a compile-time dependency, but must not be included in your portlet WAR/WEB-INF/lib directory.
With Maven, this can be accomplished with scope=provided, such as the following dependency in pom.xml:
<dependency>
<groupid>javax.portlet</groupid>
<artifactid>portlet-api</artifactid>
<scope>provided</scope>
</dependency>
PortletFaces Community Member, geändert vor 12 Jahren.
RE: How to get portlet request in jsf2 portlet
Regular Member Beiträge: 199 Beitrittsdatum: 03.04.12 Neueste Beiträge
Hi Neil
Thank you very much thats great. Thanks for the reply
Thanks
Phani
Thank you very much thats great. Thanks for the reply
Thanks
Phani