gpt4 book ai didi

grails - 初始化GroovyPageView时出错

转载 作者:行者123 更新时间:2023-12-02 14:43:55 24 4
gpt4 key购买 nike

我正在使用grails 2.3.4。当我加载index.gsp页面时,我得到:

| 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

我的 index.gsp看起来很简单:
<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>

我的 URL mapping看起来像这样:
class UrlMappings {

static mappings = {
"/api/product"(resources:"product")
"/$controller/$action?/$id?(.${format})?"{
constraints {
// apply constraints here
}
}

"/"(view:"/index")
"500"(view:'/error')

}
}

为什么会出现此错误?
非常感谢您的回答!

更新

我的 ApplicationResources.groovy文件:
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"
}

}

那就是我的文件夹结构:

最佳答案

它说异常(exception)
在属性名称(ng-app)后加上'='。
为什么在“head”标签中放入“ ng-app ”?
尝试将其删除。

关于grails - 初始化GroovyPageView时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21481780/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com