组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
toggle
Anand Raman
Challenges of integrating a JSF application with Liferay Portal
2012年12月7日 上午7:10
答复

Anand Raman

等级: New Member

帖子: 8

加入日期: 2012年11月22日

最近的帖子

Good day,

We are planning to develop our application using JSF and then integrate it into Liferay using the Liferay Faces Bridge. We would typically perform the integration at the end of each release cycle. What are the typical challenges that can come up during integration?

Best regards,
Anand
Neil Griffin
RE: Challenges of integrating a JSF application with Liferay Portal
2012年12月7日 上午8:08
答复

Neil Griffin

LIFERAY STAFF

等级: Liferay Legend

帖子: 2363

加入日期: 2005年7月26日

最近的帖子

When developing your JSF web application, be sure to avoid any casts to HttpServletRequest, HttpServletResponse, etc. Instead, use the methods on ExternalContext(). For example:

 1FacesContext facesContext = FacesContext.getCurrentInstance();
 2ExternalContext externalContext = facesContext.getExternalContext();
 3
 4// Incompatible with portlets
 5HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();
 6String attributeValue = (String) request.getAttribute("foo");
 7String parameterValue = request.getParameter("bar");
 8
 9// Compatibile with both webapps and portlets:
10String attributeValue = (String) externalContext.getRequestMap().get("foo");
11String parameterVale = externalContext.getRequestParameterMap().get("bar");


By following this type of approach, you will increase your chances that your JSF web application will be deployable as a portlet during your integration phase.