У меня сейчас проблема с граалями 3.3.9.Вот мой код:
<g:uploadForm resource="${objetInstance}"role="form" method="POST" class="form-horizontal">
<g:actionSubmit action="update" class="btn green-meadow"
value="${message(code: 'enregistrer', 'default': 'Enregistrer')}"/>
<input type="file" name="myFile" id="myFile"
class="form-control"
value=""/>
</g:uploadForm>
, и в моем контроллере я попытался:
def file = params.myFile
, но мой файл пуст.
И с:
def file = request.getFile('myFile')
Причина: groovy.lang.MissingMethodException: Нет подписи метода: net.bull.javamelody.JspWrapper $ HttpRequestWrapper3.getFile () применима для типов аргументов: (java.lang.String) значения:[myFile] Возможные решения: getXML (), getPart (java.lang.String), getAt (java.lang.String), getAt (java.lang.String), getLocale (), getJSON () в
Вверх: Чтобы получить больше информации, вот мой сборочный билд.Я думаю, что мне нужно добавить специальный плагин для обработки загрузки файла.
Я попытался: скомпилировать 'commons-fileupload: commons-fileupload: 1.4'.но все еще с той же ошибкой.Я действительно потерян.Есть идеи?
buildscript {
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
maven { url "https://mvnrepository.com/artifact" }
maven { url "https://mvnrepository.com/artifact/org.keycloak/keycloak-spring-security-adapter" }
maven { url "https://mvnrepository.com/artifact/org.jboss.logging/jboss-logging" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.15.1"
classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
classpath 'net.saliman:gradle-cobertura-plugin:2.5.4'
classpath "org.grails.plugins:views-gradle:1.2.8"
}
}
version "4.0.0_RC20"
group "myProject"
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "war"
apply plugin: "org.grails.grails-web"
apply plugin: "org.grails.grails-gsp"
apply plugin: "asset-pipeline"
apply plugin: "net.saliman.cobertura"
apply plugin: "org.grails.plugins.views-json"
apply from: "gradle/sonar.gradle"
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
maven { url "https://mvnrepository.com/artifact" }
maven { url "http://dl.bintray.com/dmahapatro/plugins" }
}
dependencies {
compile "com.warrenstrange:googleauth:1.1.2"
compile "com.google.zxing:core:3.3.1"
compile "com.google.zxing:javase:3.3.1"
compile 'org.grails.plugins:grails-spring-websocket:2.4.1'
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-dependencies"
compile "org.grails:grails-web-boot"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:scaffolding"
compile "org.grails.plugins:hibernate5"
compile "org.hibernate:hibernate-core:5.1.16.Final"
compile "org.hibernate:hibernate-ehcache:5.1.16.Final"
testCompile "org.grails:grails-datastore-gorm-test:$gormVersion"
console "org.grails:grails-console"
profile "org.grails.profiles:web"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.15.1"
runtime "com.h2database:h2"
testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails.plugins:geb"
testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1"
testRuntime "net.sourceforge.htmlunit:htmlunit:2.18"
runtime 'org.apache.tomcat:tomcat-jdbc'
compile 'org.grails:grails-logging'
//postgresql
provided 'org.postgresql:postgresql:9.4.1211'
// Build Test Data
compile "org.grails.plugins:build-test-data:3.3.1"
// Audit Logging
compile "org.grails.plugins:audit-logging:3.0.1"
// Quartz
compile "org.grails.plugins:quartz:2.0.13"
// Phone Numbers
compile 'ca.redtoad:grails-phonenumbers:0.11'
// Rest Client
compile 'org.grails:grails-datastore-rest-client'
// Jasper
compile "org.grails.plugins:jasper:2.1.0.RC1"
//excel import
compile 'org.grails.plugins:excel-import:3.0.2'
//Quartz monitor
compile ('org.grails.plugins:quartz-monitor:1.3'){
exclude group: 'org.grails.plugins', module: 'asset-pipeline'
}
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
compile "org.grails.plugins:views-json:1.2.8"
//ajout des dependances de keycloak
compile "org.keycloak:keycloak-spring-security-adapter:3.0.0.Final"
runtime "org.jboss.logging:jboss-logging:3.3.0.Final"
//File upload
compile 'commons-fileupload:commons-fileupload:1.4'
// Include external jars
compile fileTree(dir: 'libs', include: '*.jar')
// pour les tests
testCompile "org.grails:grails-test-mixins:3.3.0"
testCompile "org.grails:grails-gorm-testing-support:1.1.5"
testCompile "org.grails:grails-web-testing-support:1.1.5"
}
bootRun {
jvmArgs('-Dspring.output.ansi.enabled=always')
addResources = true
}
integrationTest {
testLogging {
exceptionFormat = 'full'
events 'failed', 'standardOut', 'standardError'
}
beforeTest { descriptor ->
logger.quiet " -- $descriptor"
}
}
assets {
minifyJs = true
minifyCss = true
packagePlugin = true
includes = ["metronic_v4_7_1_admin_3_rounded/*"]
}
cobertura {
coverageFormats = ['xml', 'html']
}
test.finalizedBy(project.tasks.cobertura)