How to write a java class to be accessed in liferay theme?

旧时模样 提交于 2019-12-11 13:29:26

问题


I have a Scenario where I have a java class written in JSP and its members are used in that JSP itself.

The JSP is part of a liferay portlet.

Now, I need to write that class for the velocity template in liferay theme so that I can access it in navigation.vm file.

Following is a dummy snippet -

xyz.jsp (part)

<body>
<%
final class DummyABC {
public String method1() {

}
public String method2() {

}
public String method3() {

}

}
%>
</body>

I need to access this class in my navigation.vm file.

Please help me through it.


回答1:


You can write new java class and create a object in init.vm file so that navigation.vm file can access this variable



来源:https://stackoverflow.com/questions/24571706/how-to-write-a-java-class-to-be-accessed-in-liferay-theme

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!