在此之前我无法添加这两个文件,因为它没有添加main.js,所以我在index.html中添加了
<script src="<%=request.getContextPath()%>/examplecalculator/app/view/main/Main.js"/>
&#13;
现在它没有加载其他两个文件。
答案 0 :(得分:1)
必需的JavaScript或CSS资源可以在liferay-portlet.xml
中加载portlet声明应该看起来像:
<portlet>
<portlet-name>YourPortletNeedingAJSresource</portlet-name>
<icon>/icon.png</icon>
<header-portlet-css>/css/main.css</header-portlet-css>
<footer-portlet-javascript>/app/view/main/Main.js</footer-portlet-javascript>
</portlet>
路径/app/view/main/Main.js是根据你的剪辑猜到的。应根据您的项目结构进行调整。