Grails 3.1.10找不到视图

斑点

我有一个带有方法show()的“ JacketController”,试图将模型呈现给视图worklist.gsp

  def show() {
        LOG.debug("JacketController:show()")
        render(view:"worklist", model:PatientSearchResult.list()) as HTML
    }

但是每次我从浏览器调用动作时,都会收到错误消息:

[Could not resolve view with name '/jacket/worklist' in servlet with name 'grailsDispatcherServlet'] with root cause  StandardWrapperValve.java 250 javax.servlet.ServletException: Could not resolve view with name /jacket/worklist' in servlet with name 'grailsDispatcherServlet'...

我认为这是在告诉我worklist.gsp不存在或放置在错误的位置,但是worklist.gsp在grails-app / views / jacket目录中。

我的网址映射如下所示:

        "/jacket" {
        controller = { 'jacket' }
        action = { GET: 'show' }
    }

我不知道我是否缺少插件或什么,但是我的build.gradle在这里:(原谅格式)

buildscript {
ext {
    grailsVersion = project.grailsVersion
}
repositories {
    mavenLocal()
    maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
    classpath "org.grails:grails-gradle-plugin:$grailsVersion"
    classpath "org.grails.plugins:hibernate4:5.0.10"
    classpath "org.grails.plugins:views-gradle:1.0.12"
    classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.11.2"
 }} configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
    if (details.requested.name == 'log4j') {
        details.useTarget "org.slf4j:log4j-over-slf4j:1.7.5"
    }
    if (details.requested.name == 'commons-logging') {
        details.useTarget "org.slf4j:jcl-over-slf4j:1.7.5"
    }

} }

版本“ 0.1”组“ viops”

应用插件:“ eclipse”应用插件:“ idea”应用插件:“ war”应用插件:“ org.grails.grails-web”应用插件:“ org.grails.plugins.views-json”应用插件:“ org。 grails.grails-gsp“应用插件:” asset-pipeline“

ext {grailsVersion = project.grailsVersion gradleWrapperVersion = project.gradleWrapperVersion}

存储库{mavenLocal()maven {url“ https://repo.grails.org/grails/core ”}}

dependencyManagement {imports {mavenBom“ org.grails:grails-bom:$ grailsVersion”} applyMavenExclusions false}

依赖项{//此顶层提取了Grails Logback日志记录解决方案,并//将其替换为log4j2 //使用Log4j2添加了新方法,是的,spring使它易于编译“ org.springframework.boot:spring-boot-starter-log4j2 ”

// changed spring-boot-autoconfigure so that it would not
// pull in the logback binding/implementation
compile('org.springframework.boot:spring-boot-autoconfigure') {
    exclude group: 'ch.qos.logback', module: 'logback-classic'
}
compile ('org.springframework.boot:spring-boot-starter-actuator'){
    exclude group: 'ch.qos.logback', module: 'logback-classic'
}


// and finally, added the log4j2 binding/implementation
compile "org.apache.logging.log4j:log4j-api:2.5"
compile "org.apache.logging.log4j:log4j-core:2.5"

compile "org.grails:grails-core"
provided "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-plugin-url-mappings"
compile "org.grails:grails-plugin-rest"
compile "org.grails:grails-plugin-codecs"
compile "org.grails:grails-plugin-interceptors"
compile "org.grails:grails-plugin-services"
compile "org.grails:grails-plugin-datasource"
compile "org.grails:grails-plugin-databinding"
compile "org.grails:grails-plugin-async"
compile "org.grails:grails-web-boot"
compile "org.grails:grails-logging"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:hibernate4"
compile "org.hibernate:hibernate-ehcache"
compile "org.grails.plugins:views-json"
console "org.grails:grails-console"
profile "org.grails.profiles:rest-api"
runtime "com.h2database:h2"
testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails.plugins:geb"
testCompile "org.grails:grails-datastore-rest-client"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18" }

谁能指出我正确的方向?

斑点

quindimildev在评论中发布了答案。

首先,我应该已经使用网络配置文件创建了一个应用程序。因此,我使用Web配置文件创建了一个新项目,并将生成的构建文件与现有应用程序进行了比较。

我提出了REST概要文件中缺少的依赖项,并注释了可能有冲突的一对夫妇。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

找不到 Grails 3 Cookie 插件

来自分类Dev

grails 3 url和grails找不到控制器

来自分类Dev

Grails找不到控制器的视图

来自分类Dev

Grails 3 限制索引视图中的列

来自分类Dev

Grails 3.0.0.M1-创建插件-找不到方法bintray

来自分类Dev

Grails 3数据库迁移插件-找不到任务'dbmGenerateChangelog'

来自分类Dev

找不到Grails 1.3.7插件

来自分类Dev

保存实体时,Grails 3集成测试会抛出“找不到当前线程的会话”休眠异常

来自分类Dev

找不到Grails控制器URL

来自分类Dev

grails找不到geb功能测试

来自分类Dev

在Grails中找不到表“ XXX”

来自分类Dev

Gvm Grails,Intellj找不到SDK

来自分类Dev

Grails找不到我的资源

来自分类Dev

grails codenarc“找不到错误脚本:Codenarc”

来自分类Dev

找不到Grails控制器URL

来自分类Dev

FileNameController 在 Yii 1 中找不到请求的视图“创建”

来自分类Dev

Grails 3 CSRF保护

来自分类Dev

Grails 3微服务

来自分类Dev

Grails 3功能测试

来自分类Dev

访问资源grails 3

来自分类Dev

Grails 3插件配置

来自分类Dev

CakePHP 3.x UnitTest“找不到基本表或视图”

来自分类Dev

Groovy / Grails的承诺/未来。没有.resolve(1,2,3)方法。奇怪?

来自分类Dev

Grails:如何创建视图?

来自分类Dev

Grails GSON JSON 视图

来自分类Dev

ASP.NET Core 3 MVC:如果找不到所需的视图,则提供默认视图

来自分类Dev

Grails 3加载静态文件

来自分类Dev

Grails 3和LDAP认证

来自分类Dev

Grails 3没有包装?