Fórum
The method is undefined for the type view_jsp ERROR
Soukaina HAJI, modificado 9 Anos atrás.
The method is undefined for the type view_jsp ERROR
Regular Member Postagens: 195 Data de Entrada: 17/06/14 Postagens Recentes
Hello,
I developed a method which allows me to get the Id of all structure and return it in a string value , i put it in init asset_publisher/init.jsp:
and I called this method from asset_publisher/view.jsp like this :
the code seem to be fine , but i get this error :
thank you
Liferay 6.2 ce ga2
I developed a method which allows me to get the Id of all structure and return it in a string value , i put it in init asset_publisher/init.jsp:
<%!
public static String getStructureFieldValue(ThemeDisplay themeDisplay, Long groupId) {
String fieldValue = "";
List<journalstructure> structures =null;
try {
structures = JournalStructureServiceUtil.getStructures(groupId);
/*getName(locale) or languageId */
for (JournalStructure structureL : structures) {
fieldValue += "," + structureL.getId();
}
}
catch(Exception pe) {
pe.printStackTrace();
}
return fieldValue;
}
%></journalstructure>
and I called this method from asset_publisher/view.jsp like this :
<%Long groupIdT = themeDisplay.getLayout().getGroupId();
String fieldValue = getArticleFieldValue(themeDisplay,groupIdT);
%>
<span class="testField"><%= fieldValue %></span>
the code seem to be fine , but i get this error :
Une erreur s'est produite à la ligne: 169 dans le fichier jsp: /html/portlet/asset_publisher/view.jsp__The method getArticleFieldValue(ThemeDisplay, Long) is undefined for the type view_jsp__166: contextObjects.put(PortletDisplayTemplateConstants.ASSET_PUBLISHER_HELPER, AssetPublisherHelperUtil.getAssetPublisherHelper());__167: __168: Long groupIdT = themeDisplay.getLayout().getGroupId();__169: String fieldValue = getArticleFieldValue(themeDisplay,groupIdT);__170: %>__171: __172: <span class="testField"><%= fieldValue %></span>______Stacktrace: [Sanitized]
thank you
Liferay 6.2 ce ga2
Soukaina HAJI, modificado 9 Anos atrás.
RE: The method is undefined for the type view_jsp ERROR (Resposta)
Regular Member Postagens: 195 Data de Entrada: 17/06/14 Postagens Recentes
Solution:
change public to private for getStructureFieldValue method
thank you @Pankaj Kathiriya
change public to private for getStructureFieldValue method
thank you @Pankaj Kathiriya