2015-04-02 73 views
0

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

<%@ 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> 

这是错误: 未捕获的SyntaxError:意外的标记<(15:31:33:007 |错误,JavaScript)的 在http://localhost:8080/WebApplicationTEST/%3Cbower_components/webcomponentsjs/webcomponents.min.js:3

回答

0

的价值script标记中的src属性不应以<开头,删除它应该有所斩断。

+0

我删除我有相同的错误: 未捕获的SyntaxError:意外令牌<(21:56:22:889 |错误,JavaScript)的 在幅/ bower_components/webcomponentsjs/webcomponents.min.js:3 – subo 2015-04-02 19:59:48

+0

在http://webcomponents.org/上,您可以下载webcomponents polyfill(webcomponents.js)的未缩小版本。如果您导入此代替缩小版本,则可能会缩小错误。 – idleherb 2015-04-02 20:05:44

+0

什么都没有......我认为这个问题是因为glassfish服务器不知道如何解释聚合物元素。当我使用 '<登录配置> 基本' 比作品。如果我使用aut-method FORM来指定我自己的登录页面,那么比我有这个问题。 P.S:下载聚合物的元素我使用凉亭 – subo 2015-04-02 20:29:50