Complete the installation to start writing programs. The cat is done in accordance with the examples in the book. The book is an example of a running club.First define the domain object, here are two objects, Podio and registration. It's a 1:n relationship.The code is as follows:
Runway
class Race {
string name//name
date StartDateTime//start time
string city//urban
String State State
float distance
float cost
Integer maxrunners = 10000//maximum number of
Take the development of a gtest project as an example
Select a directory and create a project in the command line:
Grails create-app gtest
CD gtest
Create a class and controller:
Grails create-Domain-class com. Do. myclass
Grails create-controller com. Con. mycontrol.
WriteCodeAnd after the test case, execute the test:
Unit to develop a Web program, I do not understand PHP, Java, the emergency cramming Internet to find a bit, said Grails development how fast, and so on. A trial, a few minutes on the use of scaffold (scaffolding) developed a program, but the effect is full English, database fields do not accept Chinese. Online with the Chinese field, change the field display related articles, posts did not, had to buy the province science and Technology bookstore onl
Release date:Updated on:
Affected Systems:VMWare Grails 2.xVMWare Grails 1.xDescription:--------------------------------------------------------------------------------Cve id: CVE-2012-1833
Grails is an open-source framework for rapid Web application development. Based on the Groovy programming language, Grails is bu
We really develop a project, is inseparable from the IDE. And Eclipse is just one of the most common Ides of the Java platform. So when I get to the Grails platform, the first idea is how to integrate it into eclipse.
It's really easy to integrate grails projects into eclipse, but there are a few areas to look out for. The following is the process of integrating the Gr
_ The Convention is better than configuration __, and it is not unnecessary. Some necessary things must be configured, such as the lifeline of the database.
In grails, what we need to configure is mainly in the 'conf' directory
# 'Datasource. Groovy'
Database Configuration
# 'Datasource '-- Database Configuration
### 'Driverclassname'
If it is MySQL, use its JDBC bar 'com. MySQL. JDBC. Driver'
### 'Username'
'Password' is required
Database, we don
Silver bullet developed by Java Enterprises: grails + EJB
InfoqPublished an articleJason RandolphWrittenArticleThe question is:"Grails + EJB Domain Models step-by-step". This article createsEjb3OfDomain Model(Employees and their computers), useGrailsAdded the add, delete, and modify functions for the object class above. The entire process andGrailsVery close, veryCool.
GrailsObject link ing(
Grails Project The default port number is 8080, how to modify it, search on the internet a lot is about using command line parameters, more trouble, each time you start to enter. Finally, we can use the following method to modify it, assuming the new port number is 9000:
1. Runtime changes
Each time you start a grails application, you can use the-dserver.port parameter to modify the default port number, a
A simple way to queryUse of 1.findAllWhereIn Grails, the difference between find and FindAll is that the find defaults out the first record of the query, and FindAll is the one that queries all the records.DefUsefindallwhere() { Defcity=cityinfo. Findallwhere (code:ID: 1) iteratorcityinfo> it=city.iterator (); def buf= new stringbuffer (); while (It.hasnext ()) { cityinfo C=it.next (); Buf.append (C.getid () +} render buf.tostring (); If
> Almost every Web Service provides two types of routes: __cgi _ and _ rest _.
> CGI: 'http: // example/user/Zhang san'
> Rest: 'http: // example/user? Name = James'
> At a glance, the differences between the two styles are listed above. Of course, they can also be mixed.
Grails also supports these routing styles. Although it emphasizes that the Convention is better than the configuration, it cannot avoid precise control over the URI routing address
Ruby on rail Despite the ongoing interest in software engineering, enterprise-class development rooms still have a lot of mistrust. Why? "Can the scripting language framework also fit into enterprise applications?" "The main argument for ROR is that they lack enterprise-class services (such as distributed transactions, messages, etc.)." For many businesses, platforms without these services are not considered at all. Grail is a fast enterprise-level rapid application development tool. It is based
Referring to the North American War of Independence, the first reaction in most people's minds was the words "Washington", "the Gunfire of Lexington" and "The Victory of York", and what we are going to say today is the "York victory", known as the war after the North American Revolution.What is there to talk about in this battle? Is it that Washington led the high-spirited army to sweep the fallen leaves an
Label: grails createcriteria group by hql I. totalcount Recently, when using group by in createcriteria in grails development project, we found that the totalcount in pagedresultlist has a problem. After reading a lot of unofficial official materials, I finally came up with a temporary and convenient solution: Int totalcount = domain.exe cutequery ('select count (*) fromDomainWhere ID in (select Min (ID
Grails Domain has the function of automatic verification, but when I define the attribute of Domain, I define a field of the int type, and then use String when entering the field on the page, then he starts the automatic verification function and reports the following verification information.
Failed to convert property value of type [java. lang. String] to required type [int] for propertyAge; nested exception is java. lang. IllegalArgumentException:
Grails Development platform In view technology, my favorite technology, in addition to the introduction of flash variables, is template technology.
The most convenient reuse technology for the Java platform in view is include. Although tiles and so on are very powerful, but because of the cumbersome configuration, so that they as the entire project layout outside, almost no application. Include is convenient to use, but it has a natural weakness in t
After upgrading to Grails 2.3.2, run the Times as follows:
Copy Code code as follows:
Exception in thread "main"
Error |
Forked Grails VM exited with error
Java.lang.instrument Assertion FAILED * * *: "!erroroutstanding" with the message transform method called FAILED at.. /.. /.. /src/share/instrument/jplisagent.c line:844
See jira:http://jira.grails.org/browse/
Grails uses log4j log information and log4j configuration information is written in Config.groovy files.
One, Grails 1.1 can specify different logging levels for the code under different packages, such as:
log4j = { // 设置控制器和GSP页面的级别为error error 'org.codehaus.groovy.grails.web.servlet', // controllers 'org.codehaus.groovy.grails.web.pages' // GSP // 设置插件中的日志级别为warn warn 'org.codehaus.groovy.grails.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.