Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
Anand Raman
Challenges of integrating a JSF application with Liferay Portal
7 de diciembre de 2012 7:10

Anand Raman

Ranking: New Member

Mensajes: 8

Fecha de incorporación: 22 de noviembre de 2012

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,
Neil Griffin
RE: Challenges of integrating a JSF application with Liferay Portal
7 de diciembre de 2012 8:08

Neil Griffin


Ranking: Liferay Legend

Mensajes: 2511

Fecha de incorporación: 26 de julio de 2005

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:

 1FacesContext facesContext = FacesContext.getCurrentInstance();
 2ExternalContext externalContext = facesContext.getExternalContext();
 4// Incompatible with portlets
 5HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();
 6String attributeValue = (String) request.getAttribute("foo");
 7String parameterValue = request.getParameter("bar");
 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.

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!