Hi all ,
i'm using Grails 2.5.1 on Windows 7 64 bit , After
generating the controllers and the views using Grails command
generate-all "*"
When i add any new lines in my controllers i get the below error :
Compilation
error: startup failed:
E:\Development\eclipse\TekDays\grails-app\controllers\com\tekdays\TekEventController.groovy:
47: Ambiguous expression could be a parameterless closure expression, an
isolated open code block, or it may continue
a previous
statement;
solution:
Add an explicit parameter list, e.g. {it -> ...}, or force it to be treated
as an open block by giving it a label, e.g. L:{...}, and also either remove the
previous newline, or add an explicit semicolon ';'
@ line 47,
column 4.
{
^
1
error
here is my controller :
package com.tekdays import static org.springframework.http.HttpStatus.* @Transactional(readOnly = true)class TekEventController{ def taskService // this what i added static allowedMethods = [save: "POST", update: "PUT", delete: "DELETE"] def index(Integer max) { params.max = Math.min(max ?: 10, 100) respond TekEvent.list(params), model:[tekEventInstanceCount: TekEvent.count()] } def show(TekEvent tekEventInstance) { respond tekEventInstance } def create() { respond new TekEvent(params) } @Transactional def save(TekEvent tekEventInstance) { if (tekEventInstance == null) { notFound() return } if (tekEventInstance.hasErrors()) { respond tekEventInstance.errors, view:'create' return } tekEventInstance.save flush:true taskService.addDefaultTasks(tekEventInstance) // this what i added request.withFormat { form multipartForm { flash.message = message(code: 'default.created.message', args: [message(code: 'tekEvent.label', default: 'TekEvent'), tekEventInstance.id]) redirect tekEventInstance } '*' { respond tekEventInstance, [status: CREATED] } } } def edit(TekEvent tekEventInstance) { respond tekEventInstance } @Transactional def update(TekEvent tekEventInstance) { if (tekEventInstance == null) { notFound() return } if (tekEventInstance.hasErrors()) { respond tekEventInstance.errors, view:'edit' return } tekEventInstance.save flush:true request.withFormat { form multipartForm { flash.message = message(code: 'default.updated.message', args: [message(code: 'TekEvent.label', default: 'TekEvent'), tekEventInstance.id]) redirect tekEventInstance } '*' { respond tekEventInstance, [status: OK] } } } @Transactional def delete(TekEvent tekEventInstance) { if (tekEventInstance == null) { notFound() return } tekEventInstance.delete flush:true request.withFormat { form multipartForm { flash.message = message(code: 'default.deleted.message', args: [message(code: 'TekEvent.label', default: 'TekEvent'), tekEventInstance.id]) redirect action:"index", method:"GET" } '*' { render status: NO_CONTENT } } } protected void notFound() { request.withFormat { form multipartForm { flash.message = message(code: 'default.not.found.message', args: [message(code: 'tekEvent.label', default: 'TekEvent'), params.id]) redirect action: "index", method: "GET" } '*' { render status: NOT_FOUND } } }}
--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-disc...@googlegroups.com.
To post to this group, send email to grails-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/3c531b41-2f2f-48bc-a794-44b6f872a758%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-discuss+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-disc...@googlegroups.com.
To post to this group, send email to grails-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/3c531b41-2f2f-48bc-a794-44b6f872a758%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-disc...@googlegroups.com.
To post to this group, send email to grails-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/e148fbc2-757b-4b49-a4b7-402fe2212ee0%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-discuss+unsub...@googlegroups.com.
To post to this group, send email to grails-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/3c531b41-2f2f-48bc-a794-44b6f872a758%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-discuss+unsub...@googlegroups.com.
To post to this group, send email to grails-de...@googlegroups.com.