xml.MarkupBuilder in Groovy
Typical use of the builder starts with: import groovy.xml.MarkupBuilder def writer = new StringWriter() def xml = new MarkupBuilder(writer) ... String generatedXml = writer.toString() Then the "building" part is what's…
Typical use of the builder starts with: import groovy.xml.MarkupBuilder def writer = new StringWriter() def xml = new MarkupBuilder(writer) ... String generatedXml = writer.toString() Then the "building" part is what's…
Two clients will be covered: XMemcached and spymemcached Xmemcached Add dependency Add in BuildConfig.groovy: dependencies { ... compile 'com.googlecode.xmemcached:xmemcached:1.4.2' } Set up the bean Add in conf/spring/resources.groovy: beans = {…
Multiple Apps Two logical partitions of services, perhaps one public-facing with GSPs serving up UI and one headless with REST services, can be easier to maintain if implemented as separate…
Services Content here applies to Grails 2.1.3 and may also apply to newer versions. Setup We start with three service classes: OneService, TwoService, and ThreeService. OneService uses TwoService which uses…
Prerequisite Maven 3.x installed - try http://maven.apache.org/download.cgi Important: earlier versions of Maven, such as 2.x, won't work correctly Set-up Locate a subdirectory and run: mvn archetype:generate When prompted, use maven-archetype-quickstart…
Scripts vs. parameters The "grails run-script" task allows running a bunch of scripts, and therein lies the problem: the parameters passed to the command are interpreted by the command to…
Seems like there are many flavors of the name for a Grails class: fullName -- Returns the full name of the class in the application with the the trailing convention part…