Grails 3.1.10可以';我找不到风景
我有一个带有show()方法的“JacketController”,试图将模型呈现到view worklist.gsp 但每次我从浏览器调用操作时,都会出现错误: 我认为它告诉我worklist.gsp不存在或位于错误的位置,但worklist.gsp位于grails app/views/jacket目录中 我的url映射如下所示:Grails 3.1.10可以';我找不到风景,grails,gsp,Grails,Gsp,我有一个带有show()方法的“JacketController”,试图将模型呈现到view worklist.gsp 但每次我从浏览器调用操作时,都会出现错误: 我认为它告诉我worklist.gsp不存在或位于错误的位置,但worklist.gsp位于grails app/views/jacket目录中 我的url映射如下所示: "/jacket" { controller = { 'jacket' } action = { GET: 'sho
"/jacket" {
controller = { 'jacket' }
action = { GET: 'show' }
}
我不知道我是否缺少一个插件或者什么,但是我的build.gradle在这里:(请原谅格式)
版本“0.1”组“viops”
应用插件:“eclipse”应用插件:“idea”应用插件:“war”应用
插件:“org.grails.grailsweb”应用
插件:“org.grails.plugins.views json”应用
插件:“org.grails.grailsgsp”应用插件:“资产管道”
分机{
grailsVersion=project.grailsVersion
gradleWrapperVersion=project.gradleWrapperVersion}
存储库{
mavenLocal()
maven{url”“}
依赖管理{
进口{
mavenBom“org.grails:grailsbom:$grailsVersion”
}
ApplyVeneExclusions false}
依赖关系{
//这个顶部部分引出了Grails Logback日志解决方案,并
//将其替换为log4j2
//添加了使用Log4j2的新方法,是的,spring使它变得简单
编译“org.springframework.boot:spring-boot-starter-log4j2”
有人能给我指出正确的方向吗?昆迪米尔杰夫在评论中给出了答案 首先,我应该用web配置文件创建一个应用程序。因此,我用web配置文件创建了一个新项目,并将生成的构建文件与现有应用程序进行了比较
我带来了REST配置文件中缺少的依赖项,并注释掉了一些可能存在冲突的依赖项。quindimildev在注释中给出了答案 首先,我应该用web配置文件创建一个应用程序。因此,我用web配置文件创建了一个新项目,并将生成的构建文件与现有应用程序进行了比较
我带来了REST配置文件中缺少的依赖项,并注释掉了一些可能存在冲突的依赖项。您缺少了使gsp正常工作的依赖项:
compile "org.grails.plugins:gsp"
您缺少使gsp正常工作的依赖项:
compile "org.grails.plugins:gsp"
尝试包含web配置文件依赖项+quindimildev谢谢。我所做的是用web配置文件创建一个新项目,并比较生成的生成文件。我带来了REST配置文件中缺少的依赖项,并注释掉了一些可能有冲突的依赖项。现在可以工作了。欢迎您回答,并标记为solved;)尝试包含web配置文件依赖项+quindimildev谢谢。我所做的是用web配置文件创建一个新项目,并比较生成的生成文件。我带来了REST配置文件中缺少的依赖项,并注释掉了一些可能有冲突的依赖项。现在可以工作了。欢迎您回答,并标记为已解决;)
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"
}
} }
// 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" }
compile "org.grails.plugins:gsp"