Multiple Spring MVC Portlets names are not displayed in Add Widget menu when added in the same WAR file


  • When creating custom widgets, if multiple widgets are deployed within the same war file, the individual names of the widgets are not seen in the Add Widget menu within Liferay
  • Instead, each widget shares the same name


  • Liferay DXP 7.3


  • This occurs if a widget specific name is not defined in the file.
  • When fetching a widget's name, the following code is executed: Liferay will first search the language file for a key specific to each widget deployed in the WAR file.
  • For example, it may be looking for the following two keys:
  • If these have not been defined in the file, Liferay will fall back on the generic title key defined, by default:
    This is why both widgets may show the generic title in the Add Widget menu.
  • In order to have a unique title appear, the following keys (example shown) must be added to /test-portlet/src/main/resources/content/
    javax.portlet.title.testportlet_WAR_testportlet=The Test Portlet Title
    javax.portlet.title.myportlet_WAR_testportlet=The My Portlet Title
    This file is generally located at /WEB-INF/classes/content/
0 人中有 0 人觉得有帮助