Fórumok

portletConfig is different on different servers

Boudewijn van weert, módosítva 16 év-val korábban

portletConfig is different on different servers

New Member Bejegyzések: 7 Csatlakozás dátuma: 2007.10.22. Legújabb bejegyzések
Hello,

I'm trying to access portletConfig to obtain the portlet resource bundle of a jsf/facelets/icefaces portlet with the following code:

PortletRequest req = JSFPortletUtil.getPortletRequest(facesContext);
portletConfig= (PortletConfig) req.getAttribute("com.liferay.portal.kernel.servlet.PortletServletConfig");
...
result = portletConfig.getResourceBundle(locale).getString((String)key);

This works fine on my local server (4.3.3), and returns the desired value.

However, on the pre-production server (4.3.4), req.getAttribute("com.liferay.portal.kernel.servlet.PortletServletConfig") returns org.apache.catalina.core.StandardWrapperFacade instead of PortletConfig.

Is there any explanation for this? Is this a configuration issue? Any other way to obtain the resourceBundle?

Regards, Bo
thumbnail
Ray Augé, módosítva 16 év-val korábban

Re: [Liferay Forums][3. Development]portletConfig is different on different

Liferay Legend Bejegyzések: 1197 Csatlakozás dátuma: 2005.02.08. Legújabb bejegyzések
> PortletRequest req = JSFPortletUtil.getPortletRequest(facesContext);
> portletConfig= (PortletConfig)
> req.getAttribute("com.liferay.portal.kernel.servlet.PortletServletConfig");
> ...
> result =
> portletConfig.getResourceBundle(locale).getString((String)key);
>


Try

portletConfig= (PortletConfig)
req.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG);


and see if that works.
Boudewijn van weert, módosítva 16 év-val korábban

RE: Re: [Liferay Forums][3. Development]portletConfig is different on diffe

New Member Bejegyzések: 7 Csatlakozás dátuma: 2007.10.22. Legújabb bejegyzések
Hi,

yesterday I tried the option you mentioned again (I already tried it before, with changing success), and it seemed to work, also on the preproduction machine.

However, today I tried it again, and now this attribute doesn't appear anymore.
I revised the logs (I'm logging all available attributes during the call), and yesterday the attribute *was* available, today it *isn't*.

The only difference between yesterday and today is the following:
in order to test with the JAVAX_PORTLET_CONFIG attribute, I created the same portlet as the original one, but obtaining the portletConfig with JAVAX_PORTLET_CONFIG; so there were 2 portlets on the system, although I changed the war filename and the name in portlet.xml. The portlets *both* seemed to work.
This morning I deleted the first one from tomcat. Since then, it doesn't work anymore.
So it seems that with 2 portlets the attribute exists, with one one the attribute doesn't exist.

Any thoughts?

Regards, Bo
Boudewijn van weert, módosítva 16 év-val korábban

RE: Re: [Liferay Forums][3. Development]portletConfig is different on diffe

New Member Bejegyzések: 7 Csatlakozás dátuma: 2007.10.22. Legújabb bejegyzések
Hi,

to complete the information, here are the attributes for both cases:

failing case:


INFO: attribute com.liferay.portal.kernel.servlet.PortletServletResponse, value com.liferay.portal.kernel.servlet.StringServletResponse@1f8f110d
INFO: attribute com.liferay.portal.kernel.servlet.PortletServletRequest, value com.liferay.portal.servlet.NamespaceServletRequest@7ddc5f7
INFO: [b]attribute com.liferay.portal.kernel.servlet.PortletServletConfig, value org.apache.catalina.core.StandardWrapperFacade@69a87caa[/b]
INFO: attribute javax.servlet.include.request_uri, value /xxxxx/compra.iface
INFO: attribute com.icesoft.faces.portlet.artifact, value com.icesoft.faces.webapp.http.portlet.PortletArtifactWrapper@3490b317
INFO: attribute javax.servlet.include.servlet_path, value /compra.iface
INFO: attribute servletkey, value persistent
INFO: attribute javax.portlet.userinfo, value {liferay.company.id=10095, liferay.user.id=10501}
INFO: attribute com.sun.facelets.legacy.ELCONTEXT, value com.sun.facelets.el.LegacyELContext@70efdf29
INFO: attribute com.icesoft.faces.NAMESPACE, value _PdVsignup_WAR_xxxxx_INSTANCE_eiu3_
INFO: attribute com.icesoft.faces.FormRequiredHidden, value {focus_hidden_field=command_link_hidden_field}
INFO: attribute com.sun.faces.managedBeanStack, value []
INFO: attribute javax.servlet.include.context_path, value /xxxxx-signup
INFO: attribute com.icesoft.faces.PORTLET, value portlet


working case:


INFO: attribute com.liferay.portal.kernel.servlet.PortletServletResponse, value com.liferay.portal.kernel.servlet.StringServletResponse@251dcdf5
INFO: attribute com.liferay.portal.kernel.servlet.PortletServletRequest, value com.liferay.portal.servlet.NamespaceServletRequest@4ed16603
NFO: attribute com.liferay.portal.kernel.servlet.PortletServletConfig, value org.apache.catalina.core.StandardWrapperFacade@47bca2dc
INFO: attribute[b] javax.portlet.config, value com.liferay.portlet.PortletConfigImpl@23b15343[/b]
INFO: attribute javax.servlet.include.request_uri, value /xxxxx-signup-2/compra.iface
INFO: attribute com.icesoft.faces.portlet.artifact, value com.icesoft.faces.webapp.http.portlet.PortletArtifactWrapper@5bbf662f
INFO: attribute javax.servlet.include.servlet_path, value /compra.iface

INFO: attribute facelets.Encoding, value UTF-8

INFO: attribute javax.portlet.userinfo, value {liferay.company.id=10095, liferay.user.id=10501}
INFO: attribute com.sun.facelets.legacy.ELCONTEXT, value com.sun.facelets.el.LegacyELContext@72cdc6b7
INFO: attribute com.icesoft.faces.NAMESPACE, value _PdVsignup2_WAR_xxxxxsignup2_INSTANCE_Z3Q7_
INFO: attribute com.icesoft.faces.FormRequiredHidden, value {focus_hidden_field=command_link_hidden_field}
INFO: attribute com.sun.faces.managedBeanStack, value []
INFO: attribute javax.servlet.include.context_path, value /xxxxx-signup-2
INFO: attribute com.icesoft.faces.PORTLET, value portlet
INFO: attribute javax.portlet.request, value com.liferay.portlet.RenderRequestImpl@15807762
IINFO: attribute javax.portlet.response, value com.liferay.portlet.RenderResponseImpl@31683e4f


Some values seem to be different. Why could that be?

Regards, Bo