0

我想使用 Polymer 创建一个登录页面。登录页面现在在 JSP 文件中创建并与 Glassfish 服务器相关联。我现在如何导入我自己的聚合物元素或简单的纸质按钮?这可能吗?我尝试过的简单示例:

    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <!DOCTYPE html>
    <html>
    <head>
        <script src="<bower_components/webcomponentsjs/webcomponents.min.js"></script>
        <link rel="import" href="bower_components/paper-button/paper-button.html">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Login Page</title>
    </head>
    <body>
        <h1>Login</h1>
        <paper-button>Login</paper-button>
    </body>
    </html>

这是错误: Uncaught SyntaxError: Unexpected token < (15:31:33:007 | error, javascript) at http://localhost:8080/WebApplicationTEST/%3Cbower_components/webcomponentsjs/webcomponents.min.js:3

4

1 回答 1

0

src标签中属性的值script不应以 开头<,删除它应该可以解决问题。

于 2015-04-02T19:52:09.850 回答