Foros de discusión

Challenges of integrating a JSF application with Liferay Portal

Anand Raman, modificado hace 11 años.

Challenges of integrating a JSF application with Liferay Portal

New Member Mensajes: 8 Fecha de incorporación: 23/11/12 Mensajes recientes
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, modificado hace 11 años.

RE: Challenges of integrating a JSF application with Liferay Portal

Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
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.