javascript - Liferay 7 CE - Osgi 模块(liferay mvc portlet)不加载 javascript 文件

标签 javascript osgi portlet liferay-7

我创建了一个新的 liferay osgi 模块。 我的 Controller 有以下标签:

@Component(
immediate = true,
property = {
    "com.liferay.portlet.display-category=Bla Modules",
    "com.liferay.portlet.instanceable=true",
    "javax.portlet.display-name=EventCalendar",
    "javax.portlet.init-param.template-path=/",
    "javax.portlet.expiration-cache=0",
    "com.liferay.portlet.footer-portlet-javascript=fullcalendar_year.js,/js/custom/main.js",
    "com.liferay.portlet.header-portlet-css=/css/fullcalendar_year.css,/css/fullcalendar.css",
    "javax.portlet.init-param.view-template=/view.jsp",
    "javax.portlet.resource-bundle=content.Language",
    "javax.portlet.security-role-ref=administrator,power-user,user"
},
service = Portlet.class

然而属性

com.liferay.portlet.footer-portlet-javascript

不会加载所有的 js 文件,它只会在调用一个文件时加载文件,如果调用多个文件则不加载任何文件。

这是一个错误还是我做错了什么?

最佳答案

我终于找到了解决方案。 它必须在单独的行中声明。

property = {
    "com.liferay.portlet.display-category=XXXXAA Modules",
    "com.liferay.portlet.instanceable=true",
    "javax.portlet.display-name=XXXXAA",
    "javax.portlet.init-param.template-path=/",
    "javax.portlet.expiration-cache=0",
    "com.liferay.portlet.footer-portlet-javascript=/js/moment.min.js",
    "com.liferay.portlet.footer-portlet-javascript=/js/fullcalendar_year.js",
    "com.liferay.portlet.footer-portlet-javascript=/js/calendarLanguages/pt.js",
    "com.liferay.portlet.footer-portlet-javascript=/js/custom/main.js",
    "com.liferay.portlet.header-portlet-css=/css/fullcalendar_year.css,/css/fullcalendar.css",
    "javax.portlet.init-param.view-template=/view.jsp",
    "javax.portlet.resource-bundle=content.Language",
    "javax.portlet.security-role-ref=administrator,power-user,user"
}

关于javascript - Liferay 7 CE - Osgi 模块(liferay mvc portlet)不加载 javascript 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43914434/

相关文章:

javascript - 如何用递归对象 extjs 填充商店?

java - GlassFish 4.1.1 和 Apache Felix 5.4.0

java - 关于运行时不是 'perfect match' 到 'RequiredExecutionEnvironment' 的警告是怎么回事?

configuration - 在编辑模式下创建 Liferay portlet

java - Spring AOP注入(inject)PortletRequest

portlet - 将简单的 Portlet 部署到 Liferay - ClassCastException

javascript - 如何根据给定的过滤器返回并获取对象属性的总和?

javascript - Ajax获取内容后,我想调用另一个ajax函数

javascript - 从请求响应创建 PDF 不适用于 axios 但适用于 native xhr

java - OSGi 中的传递依赖