Most voted "groovy" questions
Groovy is an object-oriented programming language developed for the Java platform as an alternative to the Java programming language. Groovy features Python, Ruby and Smalltalk.
Learn more…50 questions
Sort by count of
-
38
votes2
answers2228
viewsWhat is the difference between a lambda expression, a closure and a delegate?
From what I’ve been reading the three concepts are quite similar, but I was confused as to the clear and exact definition of them. As far as I know, a lambda expression for being understood as a…
-
10
votes1
answer3061
viewsWhen to use Interfaces
I always had the following question: When should I really use an interface instead of inheritance and what advantages can I get ?
-
6
votes1
answer169
viewsIs it possible to inform the size of the VARCHAR in a Namedparameter?
I’m working with a tuning of an SQL Server database. Through the query below, I can see how the bank executed some of my heaviest queries. SELECT TOP 30 deqt.TEXT AS Query, last_execution_time FROM…
-
5
votes3
answers426
viewsWhen should I wear the new one or not?
What happens here? Why is an instance of Date in this example: String dataFormatada = new Date().format("dd/MM/yyyy") Already in this example was not used the new: def data =…
-
4
votes1
answer110
viewsCriteria of the grails
Someone please tell me what this ${result[0][0]} means because they put two pair of brackets? def criteria = Person.createCriteria() def result = criteria.list { projections { max('age') min('age')…
-
4
votes6
answers201
viewsHow to remove 2 digits from each item in the list?
I have a list/array: var lista['01.um','02.dois','03.tres'] I need to create a new list like this: lista['01','02','03'] I know little of Groovy and Java, which is the correct way to create the…
-
4
votes1
answer799
viewsHow to create POST, PUT and DELETE method in Grails application?
I have a Grails 2.4.2 application that I want to communicate with another application, and this interaction should occur through a Rest service provided by Grails. Today as it is implemented just I…
-
3
votes2
answers72
viewsI don’t understand what’s going on with this controller class, explain it to me?
I really don’t get it, if someone could draw it for me,. class DisciplinaController extends GenericController<Disciplina>{ DisciplinaController() { super(Disciplina.class) } }…
-
2
votes1
answer68
viewsProblems in the installation of Grails
I set the variables GRAILS_HOME and JAVA_HOME that I used to use for the Griffon, but when trying to access the Grails I get the following error:…
-
2
votes1
answer138
viewsProblems updating registry data with dataBinding on Grails
I have the following domains: class Cliente { static belongsTo = [empresa: Empresa] static constraints = { } } class Empresa { /* aqui temos alguns atributos*/ } By creating a new register of…
-
2
votes1
answer304
viewsSql Groovy, pass the value of an IN parameter
I have the following code: def pessoaIds = [1, 2, 3, 4, 5] def query = "SELECT * FROM Pessoa WHERE id IN(?)" def pessoaList = sql.rows(query, [pessoaIds]) In this case "personList" returns an empty…
-
2
votes0
answers258
viewsChanging the Spring Security Core and Groovy Grails login form
Good afternoon, I made a change in my application to use my login form instead of the standard Spring Security Core, the redirect is occurring normally, however when clicking the Login button…
-
2
votes2
answers152
viewsWhat is the difference between instantiation in the same variable or in 3 different variables?
Follows part one: class Pessoa{ String firstName String lastName int age def address static main(args) { def p = new Pessoa() p.setFirstName("Lars") p.lastName = "Vogel" p.address = "Homestreet 3"…
-
2
votes1
answer141
viewsSpring instantiating object with @Value
In my application.properties has the algumaCoisa=joao, and when I spin the java -jar nomedo.jar, it comes null, someone can explain to me why this happens and how I arrange? @Component class…
-
2
votes1
answer67
viewsCode in infinite loop
I developed the following código to take the content of a given web page: import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; Logger logger=…
-
2
votes2
answers377
viewsTransform String into Array - Groovy
I own a String as follows: [["155","123RET"],["156","124RET"]] In other words, in it two subArrays that I need to add an item still in each one, my need is that in the end these arrays stay as…
-
1
votes0
answers78
viewsHow to get the type (class) of a groovy list
I have the code below: Set<String> list How to know the type of this list? In case it would be java.lang.String
-
1
votes1
answer480
viewsUbuntu linux deployment environment creation
I’m testing a Digital Ocean machine, it comes with Ubuntu linux (I chose), I need to create the following environment Firewall Java Tomcat7 Jenkins git MySQL MySqlAdmin Groovy Gradle Well, as you…
-
1
votes1
answer162
viewsERROR TO MANY REDIRECTS Spring Security Core and Grails
Good morning, I am developing a Grails application and decided to implement authorization and authentication the same is working perfectly however I decided to change the login form to my form and…
-
1
votes2
answers243
viewsHow can I associate 3 authors to just one book?
package crud class Start { static main(args) { Autor autor = new Autor() autor.nome = "Aline Gonzaga" autor.email ='[email protected]' autor.cpf =' 78544378654' Livro livro = new Livro(autor)…
-
1
votes4
answers277
viewsStart grails application
So, I’m starting to use grails/groovy now, along with html/css/javascript and, as a good beginner, I’m full of doubts. I created a login html page with google plus and wanted to run the application…
-
1
votes1
answer107
viewsEncrypt password in groovy
I am developing an application that will have a login screen that will be based on data (user, password) already saved in a database Mysql, and so I thought I would apply the same Hash which was…
-
1
votes1
answer130
viewsGroovy - JSON List Scheme
I have a problem reading a certain part of a file xml that I’m turning into file JSON. First I get this file with the class File and throw him in my class XmlParser, responsible for parsing my xml…
-
1
votes1
answer86
viewsDifference between closures and functions
Closures is a Function in Groovy ? There is some difference between them?
-
1
votes1
answer954
viewsArchive *.CSV with UTF-8
I created a process that takes the content of a given web page filters what is needed and generates a file *.csv of this content, you work correctly but words that have some accentuation end up…
-
1
votes0
answers306
viewsSet file cell *.CSV as merged
Is it possible for a given cell to be merged into a generated *.csv file? I ask because I am generating a *.csv file where the user should only do one Ctrl + C \ Ctrl + v in the content and paste in…
-
1
votes0
answers69
viewsGroovy with Oauth2
We are developing a call to an SMS sending Web Service that uses Oauth2 authentication. This development is being carried out in groovy. We searched in several forums how to elaborate the call,…
-
1
votes1
answer30
viewsHow to call a function more than once in a lambda Expression?
In Jenkins I’m trying to read a file with groovy and for each line check if it contains any of the information I need. Given the following content of arquivo: amarelo verde vermelho azul The code I…
-
1
votes0
answers32
viewsError in performing criteria with filter on object belonging to Composite ID
An error occurs when I try to search the Car domain class by applying a filter on the Mark which is a FK and is part of the Composite ID. class Carro implements Serializable { Marca marca LocalDate…
-
0
votes1
answer85
viewsRemove database data with GRAILS AND GORM
I’m learning a little bit about GRAILS and I’m having the following problem I can display the information of some registered users usually more when I try to delete them I can’t and I get no error,…
-
0
votes1
answer192
viewsProblems when running on grails project
I created a new project here and I’m having trouble giving run, I’m using as ide the plugin of grails to the eclipse, it does not attest any error in the code but while trying to run I get the…
-
0
votes1
answer65
viewsabout crud with attachment I’m not managing to make the save action
You’re using it to run a Grail action. It is the following that the action needs to save an attachment and a title to the attachment. Someone gives me links of Ruds with attachments?
-
0
votes2
answers206
viewsSelect from an array inside another array
I own a ArrayList which has other ArrayList within it, I got through the following scrip on Groovy: def i0 = listaTransportadoras.get([0]); def i1 = listaTransportadoras.get(1);…
-
0
votes4
answers6374
viewsEncrypt Java password with Hash sha256
i need to compare the password that the user is placing on a login screen with the one saved in the database, I found that when the user is registered is used to hash sha256 to encrypt the password,…
-
0
votes2
answers100
viewsI am not managing to modify the value of the Book class that is a Book
I’ve done everything and nothing of the value be modified... how do you do? I used inheritance in the physical book, the class is like this: class Livrofisico extends Livro{ public Livrofisico…
-
0
votes1
answer83
viewsIt’s making a mistake when I try to do the ORM
I created a table but when I run the application more than once it gives this problem. Why does this happen? environments { development{ dataSource { dbCreate = "update" // one of 'create',…
-
0
votes1
answer58
viewsSelect all records from a table with Groovy
I need to get all the records from a table from a script in Groovy, but with the script that I created it is taking only one record of each column and out of order too. Mine script this way: List…
-
0
votes0
answers97
viewsWhat is Listiterator and what is it for?
What would be the function of ListIterator? I have a variable of type List, that receives the information from my Postgresql Database, I need to access the information of this type variable List but…
-
0
votes1
answer50
viewsSSL failure on GET request with Httpbuilder Groovy
I can’t make a requisition GET on the following link using Httpbuilder from Groovy: https://sistema.planassiste.mpu.mp.br/producao/login.aspx I have tested the method below: ignoreSSLIssues() But…
-
0
votes1
answer205
viewsMore efficient way to compare two variables type List
I have two variables of the type List that need to be compared to each other to verify possible duplicates. Example of Variable Contents Variable 01: [01, Test, Active] Variable 02: [01, Test,…
-
0
votes1
answer70
viewsGood practice passing arguments to a method when they come from another function
I came across a code similar to the following: private fazerAlgo(AlgumaCoisa algumaCoisa) { Utilidades.converter( formatador.formatarParaTal( algumaCoisa.a, algumaCoisa.b, algumaCoisa.c ) ) } At…
-
0
votes2
answers220
views#GRAILS gsp search filter not passing parameters to controller
I have a form on a gsp page and this form has a g:textField that the user will enter values and then click on a button to filter the grid values. For example: there are 3 registers on the grid...…
-
0
votes1
answer40
viewsChaining of pipelines
I’ve got two Jenkins (A and B). What I need is that job A, after finishing, start the job execution B. Since I need a user’s approval for this to happen. //algo do tipo executarJobB = input(…
-
0
votes0
answers7
viewsGroovy files . vm and vuejs
Hello, I researched my doubt but found nothing, or at least nothing related. My doubt: I have a legacy project, in it there are groovy files, . vm, js,css and so on, I understand that groovy…
-
0
votes2
answers678
viewsConvert String to Array - Java/Groovy
I need to convert a variable string in a array, I tried to do as follows, I have the variable string conteudoLote, where its value is: [["4","SCAB171301BF5","Vazio","Lexmark…
-
0
votes1
answer88
viewsDevelopment status of the Eclipse Grails-IDE plugin?
I understand the Eclipse plugin Groovy Development Tools is still being maintained by the Pivotal teams, as a release version was released on January 6, 2020. Unfortunately, this plugin does not…
eclipse groovy grails eclipse-plugin grails-pluginasked 4 years, 11 months ago Philippe Gioseffi 3,202 -
-1
votes1
answer135
viewsConverting from Java to Groovy. Problems with dynamic type promotion. How do I disable it?
I’m converting an old Java application to Groovy. The syntax conversion is smooth. The problem is dynamic Groovy typification. Let me give you an example, I declare a method foo and its overload:…
-
-1
votes1
answer16
viewsBasic authentication on Android Gradle [beginner]
I am an intern. I have an android project, I am in build.Radle, my superior said that for security purposes I could not edit the project (source code) to enter my authentication, I should find a way…
android android-studio gradle groovy android-gradleasked 3 years, 8 months ago Cristopher Vieira 11 -
-1
votes1
answer16
viewsError using Gradle distribution
I’m starting out in the groovy world with Grails. Running the command 'dbm-update' (to update with bd on my machine and the Migration etc) causes this build error. I know almost nothing of java. (…
-
-2
votes1
answer221
viewsHow to join files into folders, based on their prefixes?
I have in hand thousands of files that have common prefixes in their names, something like: [Example of prefix 1] ABC-1.mp4 ABC-2.mp4 ABC-3.mp4 [...] ABC-999.mp4 [Example of prefix 2] AAA-1.mp4…