【发布时间】:2020-01-09 20:29:59
【问题描述】:
我尝试增强一个“旧”应用程序,该应用程序使用纯 jsps 和一些 Web 组件,但它不起作用。这是否有效,还是我必须以某种不同的方式包含 Web 组件的 javascript 代码?
应用程序在 Payara 5.192 和 JEE7 上运行。
example.jsp
<head>
<script type="module" src="<%=Globals.getProperty("DIR_JSP")%>/javascript/node_modules/my-web-component/master-detail.js" />
</head>
<body>
<% funny inline java code %>
<master-detail detailsWidth="90">My content to be shown in the details view<master-detail>
</body>
【问题讨论】:
-
这只能意味着您的
my-detail.js中的customElements.define要么未执行,要么不正确。首先检查该文件是否完全加载到浏览器中。
标签: jsp web-component payara