the sample application, as shown in Listing 1.
Listing 1. News model
class Story { String link String title String description String tags String category int votesFor int votesAgainst }
This is all the code needed to model a domain object. You want to declare its properties and the types of these properties. This allows Grails to create a table for you and a dynamic creation method
Maven standard commands can also be run. For example, the command in Listing 5: listing 5. Other Maven standard commands
compile– compiling a Grails project package– build a Build
War file install– build the
War file and install it in your local Maven library
test– run the project test
Clea N-Cleanup Grails project
We briefly describe the process that the Maven command executes. When entering the MVN
> The push technology on the browser side is very mature. The grails Events push plug-in is used here.
>
> Events push is an extension of grails-platform-Core Based on http://grailsrocks.github.com/grails-platform-core/guide/ and https://github.com/Atmosphere/atmosphere.
> Here we use the Events push example and make some addendum to it.
# Create a
Recently using Grails, beginning with the 3.0.2 version, has been wrapped nullpointer error, later used in 2.5.0 version, you can create the project, but after entering the project catalog, then execute the grails program, error, the steps are as follows:1. Grails Create-app HelloWorld//Success2. CD HelloWorld3. Grails
Remotely call action in grails and grails call action
When performing a program similar to batch processing, if you need to save a large number of records in an action, this will cause the database session in grails to exceed the load, resulting in OOM.
This is because all the modifications made to the data in a request are saved in the database session of the re
build large-scale enterprise application development, this may be grails has been in the open source community but not very good promotion reasons, so give people feel this technology is very small, Lack of good application prospects. Architecture, Grails rejects the traditional DAO layer, directly divided into the view layer, controller (control) layer, service (business logic) Layer 3 layer architecture,
Reasons to choose Grails and Dojo
With the wide application of Web, the development of Web application is more and more, and most of web development is to check the deletion of database. For the deletion of a database table, the development of the design pattern based on MVC (model-view-controller) often requires Domain class, Controller, 4 pages to be censored, and the form input data to be checked. This
, Sort: "FirstName")
The above example shows that the way to extract the number of search results, mainly for a certain table search, and in the actual commercial development, there are many data search is relatively complex. Multiple tables need to be combined, or they need to be combined with a child search to get search results.
For the former, it can be achieved through the loading function by setting the relationship between the goals. However, t
The update speed of grails is really slow. Now grails 1.0rc1 enters stable. Let's take a look at some highlights of this version.
1. Orm Enhancement
1.1 DSL
The new version will support object relation mapping (ORM) domain specific language (DSL). In the future, we will no longer need to use the traditional hibernate callback ing method. Let's take a look at an example:
class Person { String firstName sta
The Java platform has evolved into a mature and reliable enterprise application platform, and a hallmark of a mature application platform is its ability to drive a wide range of derivative technologies and options that can be integrated with other technologies. This article will detail how to develop JEE using the derivative technology developed by grails, a traditional JEE application, and a different flex technology that can be used in Java. These t
Recently, when maintaining a Java project, grails was exposed. This framework is simple and efficient. to familiarize yourself with the overall process, take the common membership as an example to illustrate the overall process. Install
Install JDK
Grails.org downloads the package and creates environment variables according to readme instructions. grails-V verifies whether the package is normal.
See ht
This article is written for groovy and grails new people, and if you're already familiar with it, please stop, lest you delay your time, and if you have leisure, please criticize this article and correct me.
Groovy, a dynamic language that runs on the JVM, has syntax similar to Java syntax, is much loved by Java programmers, and supports Java syntax directly. Grails, a rails style framework based on groovy
The various comparisons between rails and grails have not stopped since rails and grails have entered people's eyes. Recently Stephan on its blog with rails and grails working trend charts. As you can see from rails and grails work trends, rails is in a fast-growing period, and gra
is pretty good. NetBeans After you open the project name, the general i18n file is stored in the "message package", locate and open the Messages_zh_cn.properties file, and NetBeans will automatically help you with all Unicode transcoding issues. Add the following lines to the file for the buttons and hints for the Chinese scaffold:
Default.create.label= new Record {0}
Default.edit.label= Edit {0}
Default.home.label= Home
DEFAULT.LIST.LABEL={0} List of details
Default.new.label= new {0} record
Overview
Grails Introduction: Grails is an open source WEB development framework that is developed with dynamic language Groovy and can be integrated with projects that are developed in Java. Grails fully embodies the principle of convention over configuration and minimizes the configuration of the project. The current mainstream Java WEB framework is too comple
The advantages of Grails
DRY (don ' t Repeat yourself, don't repeat yourself), the Convention is better than the configuration (Convention over Configuration)
The idea that dry and conventions take precedence over configuration is a new idea of the web framework that rails sprang up and was quickly and widely received and appreciated. As the rails of the Jee World, Grails brings these cutting-edge design
A typical grails application throws events at key points in the application lifecycle, whether during the build process or when creating a single component, such as a domain class or controller. We can use these application events as extension points to create listeners to intercept them and respond to them using custom behavior. In addition to the traditional Web application lifecycle of HTTP requests and responses,
Changing the grails default server portChange grails default service port
Run the grails application from the command lineProgramFor example, when grails run-app is used, it runs on port 8080 by default. However, when port 8080 of the server is occupied by other applications, an error is reported:
Server failed to
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.