掲示板

Challenges of integrating a JSF application with Liferay Portal

11年前 に Anand Raman によって更新されました。

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
11年前 に Neil Griffin によって更新されました。

RE: Challenges of integrating a JSF application with Liferay Portal

Liferay Legend 投稿: 2655 参加年月日: 05/07/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.