问题
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