Before learning anything, the most important thing is to cultivate interest, groovy one of the world's most dazzling technology--grails believe that we have already heard, I will be through the Grails Combat series to show you the charming style of grails, so that you feel the charm of
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.
Spring Web flow is a member of the spring family that simplifies the development of Web applications. The Web application development tool for spring Web flow is integrated in Grails0.6. Here's an example to show you how to use spring Web flow easily in grails.
1, "Grails create-app webflowdemo", the output is as follows:
d:\_dev\grails_appsgt;grails Create-ap
Impact of Oracle's acquisition of sun on groovy/grails
The first thing we feel is that there should be a good impact.
Oracle has long supported the Java platform. This is not an alternative to Oracle, but an inevitable choice as a competitor of Ms. Now it has acquired sun, and there is no reason not to support Java. Therefore, the future of Java is still bright.
Oracle has supported
When Ruby and rails were red and red, Java fans were not idle, and groovy was developed as a response to Ruby. Now, the response to rails is also coming ~~~~~~~~~~~~~~~ Groovy on rails (grails) 0.1 (0.1 is not 1.0) released
Thanks to the mature and powerful Java virtual machines, database drivers, and third-party class libraries,
Working with Groovy while learning grails is unavoidable, though not too deep, but it's also helpful to know a few features.
1. Get integers after dividingUse the intdiv () method to get an integer, note that this method only applies to dividing two integers , floating-point numbers do notIf,while acceptable type of 2.Groovy
Boolean
Number 0 is
Bank.log = Logbank B1 = new Bank () B1.name = "BOA" b1.minbalance = 100b1.city= "London" Bank b2 = new Bank () B2.name = "HSBC" B2 . minbalance = 100b2.city= "LA" Bank B3 = new Bank ("A", "X") log.info b3.namebank b4 = new Bank ("B", "Max", "X1") Bank B5 = new Bank ("C", 1300, "X2") log.info b5.minbalanceclass bank{def static logdef namedef minbalancedef Citypublic Bank () { // No return type, same name with class Namelog.info "inside Constructor"}//public Bank (bankname,bankminbal,bankcit
def x = new String[3]x[0] = "A" x[1] = "B" x[2] = "C" Log.info "XXXXXX 1" try{x[3] = "D"//def Z=9/0}catch (Exception e) {Log.info "Some Error" +e.getmessage () //Use E.getmessage () to print exception Information//e.printstacktrace () //This O NE is used to print the process of invoking Functions}log.info "XXXXXX 2"Result:Tue Oct 21:47:38 CST 2015:info:xxxxxx 1Tue Oct 21:47:38 CST 2015:info:some error 3Tue Oct 21:47:38 CST 2015:info: XXXXXX 2[Trainin
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.