初始化GroovyPageView时出错 [英] Error initializing GroovyPageView
本文介绍了初始化GroovyPageView时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 grails 2.3.4
。当我加载我的index.gsp页面时,我得到:
|服务器运行。浏览到http:// localhost:8080 / testApplication
|应用程序以交互模式加载。输入'stop-app'关闭。
|输入脚本名称以运行。使用TAB完成:
.... [/ testApplication]。[gsp] Servlet.service()用于上下文中的servlet [gsp] w
第i个路径[/ testApplication]抛出异常
org.codehaus.groovy.grails.web.mapping.exceptions.UrlMappingException:错误映射
ping到视图[/ index]:初始化GroovyPageView $ b $在java.util.concurrent.ThreadPoolExecutor.runWorker时出错(ThreadPoolExecutor。
java:1145)
at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor $ b $ .java:615)
at java.lang.Thread.run(Thread。 java:744)
导致:java.lang.RuntimeException:初始化GroovyPageView时出错
... 3 more
引起:org.codehaus.groovy.grails.web.taglib.exceptions。 GrailsTagException:
在属性名称(ng-app)后期望'='。
... 3 more
[/testApplication].[gsp] Servlet.service()用于
path [/ testApplication]的上下文中的servlet [gsp]抛出异常
org .codehaus.groovy.grails.web.mapping.exceptions.UrlMappingException:错误映射
ping到视图[/ index]:在java.util.concurrent.ThreadPoolExecutor.runWorker中初始化GroovyPageView $ b $时出错(ThreadPoolExecutor。
java:1145)
at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor $ b $ .java:615)
at java.lang.Thread.run(Thread.java :744)
导致:java.lang.RuntimeException:初始化GroovyPageView时出错
... 3 more
原因:org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException :
在属性名称(ng-app)之后期待'='。
... 3 more
[/testApplication].[gsp] Servlet.service()用于
path [/ testApplication]的上下文中的servlet [gsp]抛出异常
org .codehaus.groovy.grails.web.mapping.exceptions.UrlMappingException:错误映射
ping到视图[/ index]:在java.util.concurrent.ThreadPoolExecutor.runWorker中初始化GroovyPageView $ b $时出错(ThreadPoolExecutor。
java:1145)
at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor $ b $ .java:615)
at java.lang.Thread.run(Thread.java :744)
导致:java.lang.RuntimeException:初始化GroovyPageView时出错
... 3 more
原因:org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException :
在属性名称(ng-app)之后期待'='。
... 3 more
我的 index.gsp
看起来很简单:
< head ng-app>
< meta name =layoutcontent =main/>
< title>标题页< /标题>
<! - 这里我们正在加载angularjs - >
< r:require module =angular/>
< / head>
< body>
< div>
< div> Hello World!< / div>
< p>无此处{{'yet'+'!'}}< / p>
< p> 1 + 2 = {{1 + 2}}< / p>
< / div>
< / body>
和我的 URL映射
看起来像这样:
class UrlMappings {
static mappings = {
/ api / product(资源:product)
/ $ controller / $ action?/ $ id?(。$ {format})?{
constraints {
//在这里应用约束
$ b/(view:/ index)
500(view:'/ error')
}
}
为什么我得到这个错误?
我非常感谢你的回答!
UPDATE
$ b 我的 ApplicationResources.groovy
code> file:
modules = {
'angular'{
资源网址:'/ js / lib / angular-1.2.8 / angular.min.js'
资源网址:'/ js / lib / angular-1.2.8 / angular-resource.min.js'
println加载库
}
}
这是我的文件夹结构:
解决方案
它在异常
中表示在属性名称(ng-app) STRONG>。
为什么你把 ng-app 放在head标签中?
尝试删除它。
I am using grails 2.3.4
. When I load my index.gsp page I get:
| Server running. Browse to http://localhost:8080/testApplication
| Application loaded in interactive mode. Type 'stop-app' to shutdown.
| Enter a script name to run. Use TAB for completion:
....[/testApplication].[gsp] Servlet.service() for servlet [gsp] in context w
ith path [/testApplication] threw exception
org.codehaus.groovy.grails.web.mapping.exceptions.UrlMappingException: Error map
ping onto view [/index]: Error initializing GroovyPageView
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.RuntimeException: Error initializing GroovyPageView
... 3 more
Caused by: org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException:
Expecting '=' after attribute name (ng-app).
... 3 more
[/testApplication].[gsp] Servlet.service() for servlet [gsp] in context with
path [/testApplication] threw exception
org.codehaus.groovy.grails.web.mapping.exceptions.UrlMappingException: Error map
ping onto view [/index]: Error initializing GroovyPageView
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.RuntimeException: Error initializing GroovyPageView
... 3 more
Caused by: org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException:
Expecting '=' after attribute name (ng-app).
... 3 more
[/testApplication].[gsp] Servlet.service() for servlet [gsp] in context with
path [/testApplication] threw exception
org.codehaus.groovy.grails.web.mapping.exceptions.UrlMappingException: Error map
ping onto view [/index]: Error initializing GroovyPageView
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.RuntimeException: Error initializing GroovyPageView
... 3 more
Caused by: org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException:
Expecting '=' after attribute name (ng-app).
... 3 more
My index.gsp
looks simple:
<head ng-app>
<meta name="layout" content="main" />
<title>Title Page</title>
<!-- here we are loading angularjs -->
<r:require module="angular" />
</head>
<body>
<div>
<div>Hello World!</div>
<p>Nothing here {{'yet' + '!'}}</p>
<p>1 + 2 = {{ 1 + 2 }}</p>
</div>
</body>
and my URL mapping
looks like that:
class UrlMappings {
static mappings = {
"/api/product"(resources:"product")
"/$controller/$action?/$id?(.${format})?"{
constraints {
// apply constraints here
}
}
"/"(view:"/index")
"500"(view:'/error')
}
}
Why do I get this error? I really appreciate your answer!
UPDATE
My ApplicationResources.groovy
file:
modules = {
'angular' {
resource url:'/js/lib/angular-1.2.8/angular.min.js'
resource url:'/js/lib/angular-1.2.8/angular-resource.min.js'
println "Loading libs"
}
}
Thats my folder structure:
解决方案
It says in exception Expecting '=' after attribute name (ng-app). Why you put "ng-app" in "head" tag ? try to remove it.
这篇关于初始化GroovyPageView时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文