O'Reilly logo

Liferay User Interface Development by Frank Yu, Xinsheng Chen, Jonas X. Yuan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Following Liferay UI coding conventions

One way of content generation is to copy, paste, and update. Liferay portal is a mature web application framework. When you are developing a custom portlet, you can almost always copy some code snippets from the existing portlets—this saves time.

When you copy Liferay's code, you are unconsciously following Liferay's coding convention, which is a good practice: Follow the coding style of the existing Liferay code.

Here are some UI coding conventions that we can follow on a Liferay portal project.

  • For directly called JSP files, use the .jsp extension; for JSP files included in JSP files, use the .jspf extension. Here is an example:
    <%@ include file="/html/portlet/journal/article_search_results.jspf" %>
    
  • Use single ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required