Okay, the returned object is correct: org.apache.jetspeed.request.JetspeedRequestContext!
However, the ClassCastException can be thrown if you copied the jetspeed-api-xx.jar file to the /WEB-INF/lib directory of your portlet application. Because the jetspeed-api-xx.jar should be shared among the portal and portlet applications, you should not keep another file in your portlet application's lib folder. Woonsan --- On Wed, 12/17/08, Harsh Kapoor <[email protected]> wrote: > From: Harsh Kapoor <[email protected]> > Subject: RE: How to set Param for decoration value in portlet render request > To: "Jetspeed Developers List" <[email protected]>, > "[email protected]" <[email protected]> > Date: Wednesday, December 17, 2008, 9:43 AM > Hi > > Thanks again , but I have tried this , but I get a > classCastException ... > > Please see the exception below > > java.lang.ClassCastException: > org.apache.jetspeed.request.JetspeedRequestContext > at > com.mobilitec.mportal.handlers.interceptors.PortalRootChangeInterceptor.preHandleRender(PortalRootChangeInterceptor.java:32) > at > org.springframework.web.portlet.DispatcherPortlet.doRenderService(DispatcherPortlet.java:740) > at > org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:421) > at > org.springframework.web.portlet.FrameworkPortlet.doDispatch(FrameworkPortlet.java:391) > at > javax.portlet.GenericPortlet.render(GenericPortlet.java:175) > at > org.apache.jetspeed.factory.JetspeedPortletInstance.render(JetspeedPortletInstance.java:103) > at > org.apache.jetspeed.container.JetspeedContainerServlet.doGet(JetspeedContainerServlet.java:277) > at > javax.servlet.http.HttpServlet.service(HttpServlet.java:690) > at > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) > at > org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691) > at > org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:594) > at > org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:505) > at > org.apache.jetspeed.container.invoker.ServletPortletInvoker.invoke(ServletPortletInvoker.java:273) > at > org.apache.jetspeed.container.invoker.ServletPortletInvoker.render(ServletPortletInvoker.java:140) > at > org.apache.pluto.PortletContainerImpl.renderPortlet(PortletContainerImpl.java:119) > at > org.apache.jetspeed.container.JetspeedPortletContainerWrapper.renderPortlet(JetspeedPortletContainerWrapper.java:121) > at > org.apache.jetspeed.aggregator.impl.RenderingJobImpl.execute(RenderingJobImpl.java:271) > > Regards > Harsh. > > -----Original Message----- > From: Woonsan Ko [mailto:[email protected]] > Sent: Wednesday, December 17, 2008 2:04 PM > To: Jetspeed Developers List > Subject: RE: How to set Param for decoration value in > portlet render request > > Hi Harsh, > > You can do it in your portlet: > > import org.apache.jetspeed.request.RequestContext; > ... > RequestContext requestContext = (RequestContext) > renderRequest.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE); > requestContext.setSessionAttribute("var1", > "value1"); > > Because the Jetspeed API interfaces are accessible from all > portlets on Jetspeed Portal, you can use it like the above > example. > Of course, this kind of code should be dependent on > Jetspeed Portal platform. > > Regards, > > Woonsan > > --- On Wed, 12/17/08, Harsh Kapoor > <[email protected]> wrote: > > > From: Harsh Kapoor <[email protected]> > > Subject: RE: How to set Param for decoration value in > portlet render request > > To: "Jetspeed Developers List" > <[email protected]>, > "[email protected]" <[email protected]> > > Date: Wednesday, December 17, 2008, 6:32 AM > > Hi > > > > Thanks for the reply. > > > > But where do I get control of Portal Session , I mean > under > > which file we need to set the solution you have > written > > earlier , because we only have code for portlets and > not for > > Portal Server under our control directly. > > > > Please Suggest... > > Regards > > Harsh. > > -----Original Message----- > > From: Woonsan Ko [mailto:[email protected]] > > Sent: Tuesday, December 16, 2008 11:08 PM > > To: Jetspeed Developers List > > Subject: Re: How to set Param for decoration value in > > portlet render request > > > > Hi Harsh, > > > > If you want that, I think you need to set an attribute > in > > the servlet session of jetspeed portal, not in the > portlet > > session. > > You can get the RequestContext to invoke > > setSessionAttribute() like the following: > > > > RequestContext requestContext = (RequestContext) > > > request.getAttribute(RequestContext.REQUEST_PORTALENV); > > > > -Woonsan > > > > --- On Tue, 12/16/08, Harsh Kapoor > > <[email protected]> wrote: > > > > > From: Harsh Kapoor > <[email protected]> > > > Subject: How to set Param for decoration value in > > portlet render request > > > To: "Jetspeed Developers List" > > <[email protected]> > > > Date: Tuesday, December 16, 2008, 5:28 PM > > > Hi All > > > > > > There is a param in decoration value , > > > > > > " > > > > > > PortalReservedParameters.PAGE_THEME_OVERRIDE_ATTRIBUTE" > > > > > > > > > If some value is set for this param then the > theme is > > > picked according to that value. > > > Basically code is like > > > > > > // Globaly override all psml themes if override > > session > > > attribute has been set > > > if (requestContext > > > > > > > > > .getSessionAttribute(PortalReservedParameters.PAGE_THEME_OVERRIDE_ATTRIBUTE) > > > != null) > > > { > > > String decoratorName = (String) > > requestContext > > > > > > > > > .getSessionAttribute(PortalReservedParameters.PAGE_THEME_OVERRIDE_ATTRIBUTE); > > > > page.setDefaultDecorator(decoratorName, > > > Fragment.LAYOUT); > > > } > > > > > > Currently I am not able to fetch the value in > > > decorationValve of the attribute which I set in > my > > portlet > > > request. > > > > > > > > > Basically I am setting value as > > > > > > Request.getPortletSession.setAttribute(PAGE_THEME_OVERRIDE_ATTRIBUTE,"tigris",PortletSession.APPLICATION_SCOPE) > > > > > > Can some one please suggest that how to set a > value > > which I > > > have in my Login Portlet handler to the request > object > > so > > > that I can retrieve it there in decoration valve. > > > > > > > > > > > > Best Regards > > > Harsh > > > > > > "DISCLAIMER: This message is proprietary to > > Aricent > > > and is intended solely for the use of the > individual > > to whom > > > it is addressed. It may contain privileged or > > confidential > > > information and should not be circulated or used > for > > any > > > purpose other than for what it is intended. If > you > > have > > > received this message in error,please notify the > > originator > > > immediately. If you are not the intended > recipient, > > you are > > > notified that you are strictly prohibited from > using, > > > copying, altering, or disclosing the contents of > this > > > message. Aricent accepts no responsibility for > loss or > > > damage arising from the use of the information > > transmitted > > > by this email including damage from virus." > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: > > > [email protected] > > > For additional commands, e-mail: > > > [email protected] > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > [email protected] > > For additional commands, e-mail: > > [email protected] > > > > > > "DISCLAIMER: This message is proprietary to > Aricent > > and is intended solely for the use of the individual > to whom > > it is addressed. It may contain privileged or > confidential > > information and should not be circulated or used for > any > > purpose other than for what it is intended. If you > have > > received this message in error,please notify the > originator > > immediately. If you are not the intended recipient, > you are > > notified that you are strictly prohibited from using, > > copying, altering, or disclosing the contents of this > > message. Aricent accepts no responsibility for loss or > > damage arising from the use of the information > transmitted > > by this email including damage from virus." > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [email protected] > For additional commands, e-mail: > [email protected] > > > "DISCLAIMER: This message is proprietary to Aricent > and is intended solely for the use of the individual to whom > it is addressed. It may contain privileged or confidential > information and should not be circulated or used for any > purpose other than for what it is intended. If you have > received this message in error,please notify the originator > immediately. If you are not the intended recipient, you are > notified that you are strictly prohibited from using, > copying, altering, or disclosing the contents of this > message. Aricent accepts no responsibility for loss or > damage arising from the use of the information transmitted > by this email including damage from virus." --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
