Hi Tobias,
That is great that you have experience! Thanks advance!
My case is that.
In my icefaces page, I use the following code to generate a URL that contains a portletId and a param that is an id of a product
Code
===========================================================
RenderResponse renderResponse =
(RenderResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
PortletURL portletURL = renderResponse.createActionURL();
portletURL.setParameter("id", "12345");
renderURL = portletURL.toString();
logger.debug("portletURL = " + portletURL.toString());
URL generated
===========================================================
http://localhost:8080/web/item?p_p_id=product_detail_portlet_WAR_WebAppName_INSTANCE_27qA&p_p_lifecycle=1&p_p_state=normal&p_p_mode=view&p_p_col_id=column-2&p_p_col_count=1&_product_detail_portlet_WAR_WebAppName_INSTANCE_27qA_id=12345
In the item page i.e. http://localhost:8080/web/item, it call a "showDetail" method via the JSF page
(Same portlet, same jspx page that generate the URL, )
============================================================================
<ice:panelGrid rendered="#{productBean.showDetail}" cellpadding="2" cellspacing="2" width="100%" columns="2">
...
...
In the showDetail method of the bean, I try to print out all the values into my log file
================================================================
FacesContext context = FacesContext.getCurrentInstance();
if (logger.isDebugEnabled()) {
Map paramMap = context.getExternalContext().getRequestParameterMap();
Iterator iter = paramMap.keySet().iterator();
while (iter.hasNext()) {
String paramKey = (String) iter.next();
logger.debug("paramKey = " + paramKey + " value = " + paramMap .get(paramKey).toString());
}
}
return context.getExternalContext().getRequestParameterMap().get(key);
---> And There has no value contains in the RequestParameterMap()
So I try "getRequestMap" instead
========================================================
FacesContext context = FacesContext.getCurrentInstance();
if (logger.isDebugEnabled()) {
Map paramMap = context.getExternalContext().getRequestMap();
Iterator iter = paramMap.keySet().iterator();
while (iter.hasNext()) {
String paramKey = (String) iter.next();
logger.debug("paramKey = " + paramKey + " value = " + paramMap.get(paramKey).toString());
}
}
return context.getExternalContext().getRequestMap().get(key);
There indeed some values contained in the requestMap but not the id that I have passed to the instance.
=================================================================================
com.wf.common.bean.BasicBean - paramKey = javax.faces.webapp.COMPONENT_TAG_STACK value = [com.sun.faces.taglib.jsf_core.ViewTag@9fbddf, com.icesoft.faces.component.portlet.PortletTag@16a925c, com.icesoft.faces.component.FormTag@1aeec48]
com.wf.common.bean.BasicBean - paramKey = javax.servlet.include.request_uri value = /WebAppName/item/detail.iface
com.wf.common.bean.BasicBean - paramKey = com.icesoft.faces.portlet.artifact value = com.icesoft.faces.webapp.http.portlet.PortletArtifactWrapper@11a9d12
com.wf.common.bean.BasicBean - paramKey = com.icesoft.faces.PORTLET value = portlet
com.wf.common.bean.BasicBean - paramKey = com.liferay.portal.kernel.servlet.PortletServletConfig value = org.apache.catalina.core.StandardWrapperFacade@169fb09
com.wf.common.bean.BasicBean - paramKey = com.liferay.portal.kernel.servlet.PortletServletResponse value = com.liferay.portal.kernel.servlet.StringServletResponse@3e1abf
com.wf.common.bean.BasicBean - paramKey = javax.portlet.config value = com.liferay.portlet.PortletConfigImpl@d37bd8
com.wf.common.bean.BasicBean - paramKey = com.icesoft.faces.NAMESPACE value = _detail_portlet_WAR_WebAppName_INSTANCE_27qA_
com.wf.common.bean.BasicBean - paramKey = productBean value = com.wf.product.bean.productBean@14e063d
com.wf.common.bean.BasicBean - paramKey = javax.faces.webapp.GLOBAL_ID_VIEW value = {_detail_portlet_WAR_WebAppName_INSTANCE_27qA_:productDetailForm=com.icesoft.faces.component.FormTag@1aeec48}
com.wf.common.bean.BasicBean - paramKey = javax.servlet.include.context_path value = /WebAppName
com.wf.common.bean.BasicBean - paramKey = com.liferay.portal.kernel.servlet.PortletServletFilterChain value = com.sun.portal.portletcontainer.appengine.filter.FilterChainImpl@17b9183
com.wf.common.bean.BasicBean - paramKey = com.liferay.portal.kernel.servlet.PortletServletRequest value = com.liferay.portal.servlet.NamespaceServletRequest@18e5318
com.wf.common.bean.BasicBean - paramKey = javax.servlet.include.servlet_path value = /search/item/detail.iface
com.wf.common.bean.BasicBean - paramKey = basicBean value = com.wf.common.bean.BasicBean@f16719
com.wf.common.bean.BasicBean - paramKey = com.sun.faces.managedBeanStack value = []
com.wf.common.bean.BasicBean - paramKey = javax.portlet.request value = com.liferay.portlet.RenderRequestImpl@a7bdab
com.wf.common.bean.BasicBean - paramKey = javax.portlet.response value = com.liferay.portlet.RenderResponseImpl@9548c3
com.wf.common.bean.BasicBean - paramKey = THEME_DISPLAY value = com.liferay.portal.theme.ThemeDisplay@9a57a0
And I try to request.getAttribute but no value again...
Do you have any idea that where I possible make mistake or...I headed the wrong direction?
Thank you very much.
Best Regards,
Elvin
Por favor, identifíquese para poder marcar esto como inapropiado