留言板

Challenges of integrating a JSF application with Liferay Portal

Anand Raman,修改在11 年前。

Challenges of integrating a JSF application with Liferay Portal

New Member 帖子: 8 加入日期: 12-11-23 最近的帖子
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
thumbnail
Neil Griffin,修改在11 年前。

RE: Challenges of integrating a JSF application with Liferay Portal

Liferay Legend 帖子: 2655 加入日期: 05-7-27 最近的帖子
When developing your JSF web application, be sure to avoid any casts to HttpServletRequest, HttpServletResponse, etc. Instead, use the methods on ExternalContext(). For example:

FacesContext facesContext = FacesContext.getCurrentInstance();
ExternalContext externalContext = facesContext.getExternalContext();

// Incompatible with portlets
HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();
String attributeValue = (String) request.getAttribute("foo");
String parameterValue = request.getParameter("bar");

// Compatibile with both webapps and portlets:
String attributeValue = (String) externalContext.getRequestMap().get("foo");
String 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.