blob: dc886ca2f70035c4bcb1213d70145900a45013d7 [file]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["setDoNotTrack", true]);
_paq.push(["disableCookies"]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://analytics.apache.org/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '79']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
<title>2 Getting Started 5.1.8</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" href="../css/main.css" type="text/css" media="screen, print" title="Style" charset="utf-8"/>
<link rel="stylesheet" href="../css/pdf.css" type="text/css" media="print" title="PDF" charset="utf-8"/>
<script type="text/javascript">
function addJsClass() {
var classes = document.body.className.split(" ");
classes.push("js");
document.body.className = classes.join(" ");
}
</script>
</head>
<body class="body" onload="addJsClass();">
<div id="navigation">
<div class="navTitle">
The Grails Framework
</div>
<div class="navLinks">
<ul>
<li>
<div id="nav-summary" onmouseover="toggleNavSummary(false)" onmouseout="toggleNavSummary(true)">
<a href="../guide/index.html" class="button">Table of contents</a>
<div id="nav-summary-childs" style="display:none;">
<div class="toc-item" style="margin-left:0"><a href="../guide/introduction.html"><strong>1</strong><span>Introduction</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/gettingStarted.html"><strong>2</strong><span>Getting Started</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/upgrading.html"><strong>3</strong><span>Upgrading from the previous versions</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/conf.html"><strong>4</strong><span>Configuration</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/commandLine.html"><strong>5</strong><span>The Command Line</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/profiles.html"><strong>6</strong><span>Application Profiles</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/GORM.html"><strong>7</strong><span>Object Relational Mapping (GORM)</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/theWebLayer.html"><strong>8</strong><span>The Web Layer</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/traits.html"><strong>9</strong><span>Traits</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/REST.html"><strong>10</strong><span>REST</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/async.html"><strong>11</strong><span>Asynchronous Programming</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/validation.html"><strong>12</strong><span>Validation</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/services.html"><strong>13</strong><span>The Service Layer</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/staticTypeCheckingAndCompilation.html"><strong>14</strong><span>Static Type Checking And Compilation</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/testing.html"><strong>15</strong><span>Testing</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/i18n.html"><strong>16</strong><span>Internationalization</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/security.html"><strong>17</strong><span>Security</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/plugins.html"><strong>18</strong><span>Plugins</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/spring.html"><strong>19</strong><span>Grails and Spring</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/scaffolding.html"><strong>20</strong><span>Scaffolding</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/deployment.html"><strong>21</strong><span>Deployment</span></a>
</div>
<div class="toc-item" style="margin-left:0"><a href="../guide/contributing.html"><strong>22</strong><span>Contributing to Grails</span></a>
</div>
</div>
</div>
</li>
<li class="separator selected">
<a id="ref-button" onclick="localToggle(); return false;" href="#">Quick Reference</a>
</li>
</ul>
</div>
</div>
<table id="colset" border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="col1">
<div id="main" class="corner-all">
<div class="toc-item prev-left"><a href="../guide/introduction.html">&lt;&lt; <strong>1</strong><span>Introduction</span></a></div>
<span id='toggle-col1' class="toggle">(<a href="#" onclick="localToggle(); return false;">Quick Reference</a>)</span>
<div class="toc-item next-right"><a href="../guide/upgrading.html"><strong>3</strong><span>Upgrading from the previous versions</span> >></a></div>
<div class="project">
<h1>2 Getting Started</h1>
<p><strong>Version:</strong> 5.1.8</p>
</div>
<div id="table-of-content">
<h2>Table of Contents</h2>
<div class="toc-item" style="margin-left:0px"><a href="#requirements"><strong>2.1</strong><span>Installation Requirements</span></a>
</div>
<div class="toc-item" style="margin-left:0px"><a href="#downloadingAndInstalling"><strong>2.2</strong><span>Downloading and Installing</span></a>
</div>
<div class="toc-item" style="margin-left:0px"><a href="#creatingAnApplication"><strong>2.3</strong><span>Creating an Application</span></a>
</div>
<div class="toc-item" style="margin-left:0px"><a href="#aHelloWorldExample"><strong>2.4</strong><span>A Hello World Example</span></a>
</div>
<div class="toc-item" style="margin-left:0px"><a href="#usingInteractiveMode"><strong>2.5</strong><span>Using Interactive Mode</span></a>
</div>
<div class="toc-item" style="margin-left:0px"><a href="#ide"><strong>2.6</strong><span>Getting Set Up in an IDE</span></a>
</div>
<div class="toc-item" style="margin-left:0px"><a href="#conventionOverConfiguration"><strong>2.7</strong><span>Convention over Configuration</span></a>
</div>
<div class="toc-item" style="margin-left:0px"><a href="#runningAndDebuggingAnApplication"><strong>2.8</strong><span>Running and Debugging an Application</span></a>
</div>
<div class="toc-item" style="margin-left:0px"><a href="#testingAnApplication"><strong>2.9</strong><span>Testing an Application</span></a>
</div>
<div class="toc-item" style="margin-left:0px"><a href="#deployingAnApplication"><strong>2.10</strong><span>Deploying an Application</span></a>
</div>
<div class="toc-item" style="margin-left:0px"><a href="#supportedJavaEEContainers"><strong>2.11</strong><span>Supported Java EE Containers</span></a>
</div>
<div class="toc-item" style="margin-left:0px"><a href="#creatingArtefacts"><strong>2.12</strong><span>Creating Artefacts</span></a>
</div>
<div class="toc-item" style="margin-left:0px"><a href="#generatingAnApplication"><strong>2.13</strong><span>Generating an Application</span></a>
</div>
</div>
<a name="2. Getting Started"><!-- Legacy link --></a>
<h1 id="gettingStarted">2 Getting Started</h1>
<div class='contribute-btn'>
<button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/5.1.x/src/en/guide/gettingStarted.adoc"'>
<i class='fa fa-pencil-square-o'></i> Improve this doc
</button>
</div>
<h2 id="requirements">2.1 Installation Requirements</h2>
<div class='contribute-btn'>
<button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/5.1.x/src/en/guide/gettingStarted/requirements.adoc"'>
<i class='fa fa-pencil-square-o'></i> Improve this doc
</button>
</div>
<div class="paragraph">
<p>Before installing Grails 5.1.8 you will need as a minimum a Java Development Kit (JDK) installed version 1.8 or above. Download the appropriate JDK for your operating system, run the installer, and then set up an environment variable called <code>JAVA_HOME</code> pointing to the location of this installation.</p>
</div>
<div class="paragraph">
<p>To automate the installation of Grails we recommend <a href="http://sdkman.io">SDKMAN</a> which greatly simplifies installing and managing multiple Grails versions.</p>
</div>
<div class="paragraph">
<p>On some platforms (for example macOS) the Java installation is automatically detected. However in many cases you will want to manually configure the location of Java. For example, if you&#8217;re using bash or another variant of the Bourne Shell:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">export JAVA_HOME=/Library/Java/Home
export PATH=&quot;$PATH:$JAVA_HOME/bin&quot;</code></pre>
</div>
</div>
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
On Windows you would have to configure these environment variables in <code>My Computer/Advanced/Environment Variables</code>
</td>
</tr>
</table>
</div>
<a name="2.1 Downloading and Installing"><!-- Legacy link --></a>
<h2 id="downloadingAndInstalling">2.2 Downloading and Installing</h2>
<div class='contribute-btn'>
<button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/5.1.x/src/en/guide/gettingStarted/downloadingAndInstalling.adoc"'>
<i class='fa fa-pencil-square-o'></i> Improve this doc
</button>
</div>
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>The first step to getting up and running with Grails is to install the distribution.</p>
</div>
<div class="paragraph">
<p>The best way to install Grails on *nix systems is with <a href="https://sdkman.io">SDKMAN</a> which greatly simplifies installing and managing multiple Grails versions.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_install_with_sdkman">Install with SDKMAN</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To install the latest version of Grails using SDKMAN, run this on your terminal:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="shell">sdk install grails</code></pre>
</div>
</div>
<div class="paragraph">
<p>You can also specify a version</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="shell">sdk install grails 5.1.8</code></pre>
</div>
</div>
<div class="paragraph">
<p>You can find more information about SDKMAN usage on the <a href="https://sdkman.io/usage">SDKMAN Docs</a></p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_manual_installation">Manual installation</h2>
<div class="sectionbody">
<div class="paragraph">
<p>For manual installation follow these steps:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://github.com/grails/grails-core/releases">Download</a> a binary distribution of Grails and extract the resulting zip file to a location of your choice</p>
</li>
<li>
<p>Set the GRAILS_HOME environment variable to the location where you extracted the zip</p>
</li>
</ul>
</div>
<div class="sect2">
<h3 id="_unixlinux">Unix/Linux</h3>
<div class="ulist">
<ul>
<li>
<p>This is typically a matter of adding something like the following <code>export GRAILS_HOME=/path/to/grails</code> to your profile</p>
</li>
<li>
<p>This can be done by adding <code>export PATH="$PATH:$GRAILS_HOME/bin"</code> to your profile</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_windows">Windows</h3>
<div class="ulist">
<ul>
<li>
<p>Copy the path to the bin directory inside the grails folder you have downloaded, for example,</p>
</li>
</ul>
</div>
<div class="listingblock">
<div class="content">
<pre>C:/path_to_grails/bin</pre>
</div>
</div>
<div class="ulist">
<ul>
<li>
<p>Go to Environment Variables, you can typically search or run the command below, the type env and then Enter</p>
</li>
</ul>
</div>
<div class="listingblock">
<div class="content">
<pre>Start + R</pre>
</div>
</div>
<div class="ulist">
<ul>
<li>
<p>Edit the Path variable on User Variables / System Variables depending on your choice.</p>
</li>
<li>
<p>Paste the copied path in the Path Variable.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>If Grails is working correctly you should now be able to type <code>grails -version</code> in the terminal window and see output similar to this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">Grails <span class="key">version</span>: <span class="float">5.1</span><span class="float">.8</span></code></pre>
</div>
</div>
</div>
</div>
</div>
<a name="2.4 Creating an Application"><!-- Legacy link --></a>
<h2 id="creatingAnApplication">2.3 Creating an Application</h2>
<div class='contribute-btn'>
<button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/5.1.x/src/en/guide/gettingStarted/creatingAnApplication.adoc"'>
<i class='fa fa-pencil-square-o'></i> Improve this doc
</button>
</div>
<div class="paragraph">
<p>To create a Grails application you first need to familiarize yourself with the usage of the <code>grails</code> command which is used in the following manner:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">grails &lt;&lt;command name&gt;&gt;</code></pre>
</div>
</div>
<div class="paragraph">
<p>Run <a href="../ref/Command%20Line/create-app.html">create-app</a> to create an application:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">grails create-app helloworld</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will create a new directory inside the current one that contains the project. Navigate to this directory in your console:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">cd helloworld</code></pre>
</div>
</div>
<a name="2.5 A Hello World Example"><!-- Legacy link --></a>
<h2 id="aHelloWorldExample">2.4 A Hello World Example</h2>
<div class='contribute-btn'>
<button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/5.1.x/src/en/guide/gettingStarted/aHelloWorldExample.adoc"'>
<i class='fa fa-pencil-square-o'></i> Improve this doc
</button>
</div>
<div class="paragraph">
<p>Let&#8217;s now take the new project and turn it into the classic "Hello world!" example. First, change into the "helloworld" directory you just created and start the Grails interactive console:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">$ cd helloworld
$ grails</code></pre>
</div>
</div>
<div class="paragraph">
<p>You should see a prompt that looks like this:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="../img/interactive-helloworld.png" alt="interactive helloworld">
</div>
</div>
<div class="paragraph">
<p>What we want is a simple page that just prints the message "Hello World!" to the browser. In Grails, whenever you want a new page you just create a new controller action for it. Since we don&#8217;t yet have a controller, let&#8217;s create one now with the <a href="../ref/Command%20Line/create-controller.html">create-controller</a> command:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">grails&gt; create-controller hello</code></pre>
</div>
</div>
<div class="paragraph">
<p>Don&#8217;t forget that in the interactive console, we have auto-completion on command names. So you can type "cre" and then press &lt;tab&gt; to get a list of all <code>create-*</code> commands. Type a few more letters of the command name and then &lt;tab&gt; again to finish.</p>
</div>
<div class="paragraph">
<p>The above command will create a new <a href="theWebLayer.html#controllers">controller</a> in the <code>grails-app/controllers/helloworld</code> directory called <code>HelloController.groovy</code>. Why the extra <code>helloworld</code> directory? Because in Java land, it&#8217;s strongly recommended that all classes are placed into packages, so Grails defaults to the application name if you don&#8217;t provide one. The reference page for <a href="../ref/Command%20Line/create-controller.html">create-controller</a> provides more detail on this.</p>
</div>
<div class="paragraph">
<p>We now have a controller so let&#8217;s add an action to generate the "Hello World!" page. In any text editor, edit the new controller&#8201;&#8212;&#8201;the <code>HelloController.groovy</code> file&#8201;&#8212;&#8201;by adding a render line. The edited file&#8217;s code should look like this:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy"><span class="keyword">package</span> helloworld
<span class="type">class</span> <span class="class">HelloController</span> {
<span class="keyword">def</span> <span class="function">index</span>() {
render <span class="string"><span class="delimiter">&quot;</span><span class="content">Hello World!</span><span class="delimiter">&quot;</span></span>
}
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>The action is simply a method. In this particular case, it calls a special method provided by Grails to <a href="../ref/Controllers/render.html">render</a> the page.</p>
</div>
<div class="paragraph">
<p>Job done. To see your application in action, you just need to start up a server with another command called <a href="../ref/Command%20Line/run-app.html">run-app</a>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">grails&gt; run-app</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will start an embedded server on port 8080 that hosts your application. You should now be able to access your application at the URL <a href="http://localhost:8080/" class="bare">http://localhost:8080/</a> - try it!</p>
</div>
<div class="paragraph">
<p>To set a context path for your application, you can add a configuration property in <code>grails-app/conf/application.yml</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="yaml"><span class="key">server</span>:
<span class="key">servlet</span>:
<span class="key">context-path</span>: <span class="string"><span class="content">/helloworld</span></span></code></pre>
</div>
</div>
<div class="paragraph">
<p>With the above configuration in place the server will instead startup at the URL <a href="http://localhost:8080/helloworld/" class="bare">http://localhost:8080/helloworld/</a>.</p>
</div>
<div class="paragraph">
<p>Alternatively, you can also set the context path via the command line:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">grails&gt; run-app -Dgrails.server.servlet.context-path=/helloworld</code></pre>
</div>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
If you see the error "Server failed to start for port 8080: Address already in use", then it means another server is running on that port. You can easily work around this by running your server on a different port using <code>run-app -port=9090</code>. '9090' is just an example: you can pretty much choose anything within the range 1024 to 49151.
</td>
</tr>
</table>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
On Windows, if you see the error "&gt; A problem occurred starting process 'command 'C:\path\to\java.exe''", run it again with the <code>--stacktrace</code> flag. If the root error is "Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long", add <code>grails { pathingJar = true }</code> to your <code>build.gradle</code> file. This is a known limitation with Windows.
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>The result will look something like this:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="../img/intropage.png" alt="intropage">
</div>
</div>
<div class="paragraph">
<p>This is the Grails intro page which is rendered by the <code>grails-app/view/index.gsp</code> file. It detects the presence of your controllers and provides links to them. You can click on the "HelloController" link to see our custom page containing the text "Hello World!". Voila! You have your first working Grails application.</p>
</div>
<div class="paragraph">
<p>One final thing: a controller can contain many actions, each of which corresponds to a different page (ignoring AJAX at this point). Each page is accessible via a unique URL that is composed from the controller name and the action name: /&lt;appname&gt;/&lt;controller&gt;/&lt;action&gt;. This means you can access the Hello World page via <a href="http://localhost:8080/helloworld/hello/index">/helloworld/hello/index</a>, where 'hello' is the controller name (remove the 'Controller' suffix from the class name and lower-case the first letter) and 'index' is the action name. But you can also access the page via the same URL without the action name: this is because 'index' is the <em>default action</em>. See the end of the <a href="theWebLayer.html#understandingControllersAndActions">controllers and actions</a> section of the user guide to find out more on default actions.</p>
</div>
<h2 id="usingInteractiveMode">2.5 Using Interactive Mode</h2>
<div class='contribute-btn'>
<button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/5.1.x/src/en/guide/gettingStarted/usingInteractiveMode.adoc"'>
<i class='fa fa-pencil-square-o'></i> Improve this doc
</button>
</div>
<div class="paragraph">
<p>Since 3.0, Grails has an interactive mode which makes command execution faster since the JVM doesn&#8217;t have to be restarted for each command. To use interactive mode simple type 'grails' from the root of any projects and use TAB completion to get a list of available commands. See the screenshot below for an example:</p>
</div>
<div class="imageblock">
<div class="content">
<img src="../img/interactive-output.png" alt="interactive output">
</div>
</div>
<div class="paragraph">
<p>For more information on the capabilities of interactive mode refer to the section on <a href="commandLine.html#interactiveMode">Interactive Mode</a> in the user guide.</p>
</div>
<a name="2.6 Getting Set-up in an IDE"><!-- Legacy link --></a>
<h2 id="ide">2.6 Getting Set Up in an IDE</h2>
<div class='contribute-btn'>
<button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/5.1.x/src/en/guide/gettingStarted/ide.adoc"'>
<i class='fa fa-pencil-square-o'></i> Improve this doc
</button>
</div>
<div class="sect3">
<h4 id="_intellij_idea">IntelliJ IDEA</h4>
<div class="paragraph">
<p><a href="http://www.jetbrains.com/idea">IntelliJ IDEA</a> is an excellent IDE for Grails 5.0 development. It comes in 2 editions, the free community edition and the paid-for ultimate edition.</p>
</div>
<div class="paragraph">
<p>The community edition can be used for most things, although GSP syntax higlighting is only part of the ultimate edition</p>
</div>
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
You can always open GSP files in the HTML editor if you just want highlighting in the community edition.
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>To get started with Intellij IDEA and Grails 5.0 simply go to <code>File / Open</code> and point IDEA at your <code>build.gradle</code> file to import and configure the project.</p>
</div>
</div>
<div class="sect3">
<h4 id="_textmate_sublime_vim_etc">TextMate, Sublime, VIM etc.</h4>
<div class="paragraph">
<p>There are several excellent text editors that work nicely with Groovy and Grails. See below for references:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>A <a href="https://github.com/textmate/groovy-grails.tmbundle">bundle</a> is available for Groovy / Grails support in <a href="http://macromates.com">Textmate</a>.</p>
</li>
<li>
<p>A <a href="https://github.com/osoco/sublimetext-grails">plugin</a> can be installed via Sublime Package Control for the <a href="http://www.sublimetext.com">Sublime Text Editor</a>.</p>
</li>
<li>
<p>See <a href="http://www.objectpartners.com/2012/02/21/using-vim-as-your-grails-ide-part-1-navigating-your-project/">this post</a> for some helpful tips on how to setup VIM as your Grails editor of choice.</p>
</li>
<li>
<p>A <a href="https://atom.io/packages/atom-grails">package</a> is available for use with the <a href="https://atom.io">Atom editor</a>.</p>
</li>
<li>
<p>An <a href="https://marketplace.visualstudio.com/items?itemName=marlon407.code-groovy">extension</a> is available for use with <a href="https://code.visualstudio.com/">Visual Studio Code</a>.</p>
</li>
</ul>
</div>
</div>
<a name="2.7 Convention over Configuration"><!-- Legacy link --></a>
<h2 id="conventionOverConfiguration">2.7 Convention over Configuration</h2>
<div class='contribute-btn'>
<button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/5.1.x/src/en/guide/gettingStarted/conventionOverConfiguration.adoc"'>
<i class='fa fa-pencil-square-o'></i> Improve this doc
</button>
</div>
<div class="paragraph">
<p>Grails uses "convention over configuration" to configure itself. This typically means that the name and location of files is used instead of explicit configuration, hence you need to familiarize yourself with the directory structure provided by Grails.</p>
</div>
<div class="paragraph">
<p>Here is a breakdown and links to the relevant sections:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>grails-app</code> - top level directory for Groovy sources</p>
<div class="ulist">
<ul>
<li>
<p><code>conf</code> - <a href="conf.html">Configuration sources</a></p>
</li>
<li>
<p><code>controllers</code> - <a href="theWebLayer.html#controllers">Web controllers</a> - The C in MVC.</p>
</li>
<li>
<p><code>domain</code> - The <a href="GORM.html">application domain</a>. - The M in MVC</p>
</li>
<li>
<p><code>i18n</code> - Support for <a href="i18n.html">internationalization (i18n)</a>.</p>
</li>
<li>
<p><code>services</code> - The <a href="services.html">service layer</a>.</p>
</li>
<li>
<p><code>taglib</code> - <a href="theWebLayer.html#taglibs">Tag libraries</a>.</p>
</li>
<li>
<p><code>utils</code> - Grails specific utilities.</p>
</li>
<li>
<p><code>views</code> - <a href="theWebLayer.html#gsp">Groovy Server Pages</a> or <a href="http://views.grails.org/latest">JSON Views</a> - The V in MVC.</p>
</li>
</ul>
</div>
</li>
<li>
<p><code>src/main/scripts</code> - <a href="commandLine.html">Code generation scripts</a>.</p>
</li>
<li>
<p><code>src/main/groovy</code> - Supporting sources</p>
</li>
<li>
<p><code>src/test/groovy</code> - <a href="testing.html">Unit and integration tests</a>.</p>
</li>
</ul>
</div>
<a name="2.8 Running and Debugging an Application"><!-- Legacy link --></a>
<h2 id="runningAndDebuggingAnApplication">2.8 Running and Debugging an Application</h2>
<div class='contribute-btn'>
<button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/5.1.x/src/en/guide/gettingStarted/runningAndDebuggingAnApplication.adoc"'>
<i class='fa fa-pencil-square-o'></i> Improve this doc
</button>
</div>
<div class="paragraph">
<p>Grails applications can be run with the built in Tomcat server using the <a href="../ref/Command%20Line/run-app.html">run-app</a> command which will load a server on port 8080 by default:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">grails run-app</code></pre>
</div>
</div>
<div class="paragraph">
<p>You can specify a different port by using the <code>-port</code> argument:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">grails run-app -port=8090</code></pre>
</div>
</div>
<div class="paragraph">
<p>Note that it is better to start up the application in interactive mode since a container restart is much quicker:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">$ grails
grails&gt; run-app
| Grails application running at http://localhost:8080 in environment: development
grails&gt; stop-app
| Shutting down application...
| Application shutdown.
grails&gt; run-app
| Grails application running at http://localhost:8080 in environment: development</code></pre>
</div>
</div>
<div class="paragraph">
<p>You can debug a grails app by simply right-clicking on the <code>Application.groovy</code> class in your IDE and choosing the appropriate action (since Grails 3).</p>
</div>
<div class="paragraph">
<p>Alternatively, you can run your app with the following command and then attach a remote debugger to it.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">grails run-app --debug-jvm</code></pre>
</div>
</div>
<div class="paragraph">
<p>More information on the <a href="../ref/Command%20Line/run-app.html">run-app</a> command can be found in the reference guide.</p>
</div>
<a name="2.9 Testing an Application"><!-- Legacy link --></a>
<h2 id="testingAnApplication">2.9 Testing an Application</h2>
<div class='contribute-btn'>
<button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/5.1.x/src/en/guide/gettingStarted/testingAnApplication.adoc"'>
<i class='fa fa-pencil-square-o'></i> Improve this doc
</button>
</div>
<div class="paragraph">
<p>The <code>create-*</code> commands in Grails automatically create unit or integration tests for you within the <code>src/test/groovy</code> directory. It is of course up to you to populate these tests with valid test logic, information on which can be found in the section on <a href="testing.html">Unit and integration tests</a>.</p>
</div>
<div class="paragraph">
<p>To execute tests you run the <a href="../ref/Command%20Line/test-app.html">test-app</a> command as follows:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">grails test-app</code></pre>
</div>
</div>
<a name="2.10 Deploying an Application"><!-- Legacy link --></a>
<h2 id="deployingAnApplication">2.10 Deploying an Application</h2>
<div class='contribute-btn'>
<button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/5.1.x/src/en/guide/gettingStarted/deployingAnApplication.adoc"'>
<i class='fa fa-pencil-square-o'></i> Improve this doc
</button>
</div>
<div class="paragraph">
<p>Grails applications can be deployed in a number of different ways.</p>
</div>
<div class="paragraph">
<p>If you are deploying to a traditional container (Tomcat, Jetty etc.) you can create a Web Application Archive (WAR file), and Grails includes the <a href="../ref/Command%20Line/war.html">war</a> command for performing this task:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">grails war</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will produce a WAR file under the <code>build/libs</code> directory which can then be deployed as per your container&#8217;s instructions.</p>
</div>
<div class="paragraph">
<p>Note that by default Grails will include an embeddable version of Tomcat inside the WAR file, this can cause problems if you deploy to a different version of Tomcat. If you don&#8217;t intend to use the embedded container then you should change the scope of the Tomcat dependencies to <code>testImplementation</code> (or <code>provided</code> if using Grails 4.x) prior to deploying to your production container in <code>build.gradle</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">testImplementation <span class="string"><span class="delimiter">&quot;</span><span class="content">org.springframework.boot:spring-boot-starter-tomcat</span><span class="delimiter">&quot;</span></span></code></pre>
</div>
</div>
<div class="paragraph">
<p>If you are building a WAR file to deploy on Tomcat 7 then in addition you will need to change the target Tomcat version in the build. Grails is built against Tomcat 8 APIs by default.
To target a Tomcat 7 container, insert a line to <code>build.gradle</code> above the <code>dependencies { }</code> section:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">ext[<span class="string"><span class="delimiter">'</span><span class="content">tomcat.version</span><span class="delimiter">'</span></span>] = <span class="string"><span class="delimiter">'</span><span class="content">7.0.59</span><span class="delimiter">'</span></span></code></pre>
</div>
</div>
<div class="admonitionblock warning">
<table>
<tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
Grails 5 contains dependencies that <em>require</em> <code>javax.el-api:3.0</code> (eg.: <code>datastore-gorm:7.x</code>, <code>spring-boot:2.x</code>) which is only supported starting from Tomcat 8.x+, based on the <a href="http://tomcat.apache.org/whichversion.html">tomcat version table</a>!
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>Unlike most scripts which default to the <code>development</code> environment unless overridden, the <code>war</code> command runs in the <code>production</code> environment by default. You can override this like any script by specifying the environment name, for example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">grails dev war</code></pre>
</div>
</div>
<div class="paragraph">
<p>If you prefer not to operate a separate Servlet container then you can simply run the Grails WAR file as a regular Java application. Example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">grails war
java -Dgrails.env=prod -jar build/libs/mywar-0.1.war</code></pre>
</div>
</div>
<div class="paragraph">
<p>When deploying Grails you should always run your containers JVM with the <code>-server</code> option and with sufficient memory allocation. A good set of VM flags would be:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">-server -Xmx768M</code></pre>
</div>
</div>
<a name="2.11 Supported Java EE Containers"><!-- Legacy link --></a>
<h2 id="supportedJavaEEContainers">2.11 Supported Java EE Containers</h2>
<div class='contribute-btn'>
<button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/5.1.x/src/en/guide/gettingStarted/supportedJavaEEContainers.adoc"'>
<i class='fa fa-pencil-square-o'></i> Improve this doc
</button>
</div>
<div class="paragraph">
<p>Grails runs on any container that supports Servlet 3.0 and above and is known to work on the following specific container products:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Tomcat 7</p>
</li>
<li>
<p>GlassFish 3 or above</p>
</li>
<li>
<p>Resin 4 or above</p>
</li>
<li>
<p>JBoss 6 or above</p>
</li>
<li>
<p>Jetty 8 or above</p>
</li>
<li>
<p>Oracle Weblogic 12c or above</p>
</li>
<li>
<p>IBM WebSphere 8.0 or above</p>
</li>
</ul>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
It&#8217;s required to set "-Xverify:none" in "Application servers &gt; server &gt; Process Definition &gt; Java Virtual Machine &gt; Generic JVM arguments" for older versions of WebSphere. This is no longer needed for WebSphere version 8 or newer.
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>Some containers have bugs however, which in most cases can be worked around. A <a href="https://grails.org/wiki/version/Deployment/92">list of known deployment issues</a> can be found on the Grails wiki.</p>
</div>
<div class="paragraph">
<p>In addition, reference the <a href="http://guides.grails.org/">Grails Guides</a> for tips on how to deploy Grails to various popular Cloud services.</p>
</div>
<a name="2.13 Creating Artefacts"><!-- Legacy link --></a>
<h2 id="creatingArtefacts">2.12 Creating Artefacts</h2>
<div class='contribute-btn'>
<button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/5.1.x/src/en/guide/gettingStarted/creatingArtefacts.adoc"'>
<i class='fa fa-pencil-square-o'></i> Improve this doc
</button>
</div>
<div class="paragraph">
<p>Grails ships with a few convenience targets such as <a href="../ref/Command%20Line/create-controller.html">create-controller</a>, <a href="../ref/Command%20Line/create-domain-class.html">create-domain-class</a> and so on that will create <a href="theWebLayer.html#controllers">controllers</a> and different artefact types for you.
NOTE: These are just for your convenience and you can just as easily use an IDE or your favourite text editor.
For example to create the basis of an application you typically need a <a href="GORM.html">domain model</a>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="bash">grails create-app helloworld
cd helloworld
grails create-domain-class book</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will result in the creation of a domain class at <code>grails-app/domain/helloworld/Book.groovy</code> such as:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy"><span class="keyword">package</span> helloworld
<span class="type">class</span> <span class="class">Book</span> {
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>There are many such <code>create-*</code> commands that can be explored in the command line reference guide.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
To decrease the amount of time it takes to run Grails scripts, use the interactive mode.
</td>
</tr>
</table>
</div>
<a name="2.12 Generating an Application"><!-- Legacy link --></a>
<h2 id="generatingAnApplication">2.13 Generating an Application</h2>
<div class='contribute-btn'>
<button type='button' class='btn btn-default' onclick='window.location.href="https://github.com/grails/grails-doc/edit/5.1.x/src/en/guide/gettingStarted/generatingAnApplication.adoc"'>
<i class='fa fa-pencil-square-o'></i> Improve this doc
</button>
</div>
<div class="paragraph">
<p>To get started quickly with Grails it is often useful to use a feature called <a href="scaffolding.html">scaffolding</a> to generate the skeleton of an application. To do this use one of the <code>generate-*</code> commands such as <a href="../ref/Command%20Line/generate-all.html">generate-all</a>, which will generate a <a href="theWebLayer.html#controllers">controller</a> (and its unit test) and the associated <a href="theWebLayer.html#gsp">views</a>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="groovy">grails generate-all helloworld.Book</code></pre>
</div>
</div>
<div style="clear:both;margin-top:15px;"></div>
<div class="toc-item prev-left"><a href="../guide/introduction.html">&lt;&lt; <strong>1</strong><span>Introduction</span></a></div>
<div class="toc-item next-right"><a href="../guide/upgrading.html"><strong>3</strong><span>Upgrading from the previous versions</span> >></a></div>
<div style="clear:both"></div>
</div>
</td>
<td id="col2">
<div class="local clearfix">
<div class="local-title">
<a href="../guide/index.html" target="mainFrame">Quick Reference</a>
<span class="toggle">(<a href="#" onclick="localToggle(); return false;">hide</a>)</span>
</div>
<div class="menu">
<div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Command Line</h1><div class="menu-sub">
<div class="menu-item"><a href="../ref/Command%20Line/Usage.html">Usage</a></div>
<div class="menu-item"><a href="../ref/Command%20Line/bug-report.html">bug-report</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/clean.html">clean</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/compile.html">compile</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/console.html">console</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/create-app.html">create-app</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/create-command.html">create-command</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/create-controller.html">create-controller</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/create-domain-class.html">create-domain-class</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/create-functional-test.html">create-functional-test</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/create-hibernate-cfg-xml.html">create-hibernate-cfg-xml</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/create-integration-test.html">create-integration-test</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/create-interceptor.html">create-interceptor</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/create-plugin.html">create-plugin</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/create-profile.html">create-profile</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/create-script.html">create-script</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/create-service.html">create-service</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/create-taglib.html">create-taglib</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/create-unit-test.html">create-unit-test</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/dependency-report.html">dependency-report</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/docs.html">docs</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/generate-all.html">generate-all</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/generate-controller.html">generate-controller</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/generate-views.html">generate-views</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/help.html">help</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/install-templates.html">install-templates</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/list-plugins.html">list-plugins</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/list-profiles.html">list-profiles</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/package-plugin.html">package-plugin</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/package.html">package</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/plugin-info.html">plugin-info</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/profile-info.html">profile-info</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/run-app.html">run-app</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/run-command.html">run-command</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/run-script.html">run-script</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/schema-export.html">schema-export</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/shell.html">shell</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/stats.html">stats</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/stop-app.html">stop-app</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/test-app.html">test-app</a>
</div>
<div class="menu-item"><a href="../ref/Command%20Line/war.html">war</a>
</div>
</div>
</div>
<div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Constraints</h1><div class="menu-sub">
<div class="menu-item"><a href="../ref/Constraints/Usage.html">Usage</a></div>
<div class="menu-item"><a href="../ref/Constraints/attributes.html">attributes</a>
</div>
<div class="menu-item"><a href="../ref/Constraints/bindable.html">bindable</a>
</div>
<div class="menu-item"><a href="../ref/Constraints/blank.html">blank</a>
</div>
<div class="menu-item"><a href="../ref/Constraints/creditCard.html">creditCard</a>
</div>
<div class="menu-item"><a href="../ref/Constraints/email.html">email</a>
</div>
<div class="menu-item"><a href="../ref/Constraints/inList.html">inList</a>
</div>
<div class="menu-item"><a href="../ref/Constraints/matches.html">matches</a>
</div>
<div class="menu-item"><a href="../ref/Constraints/max.html">max</a>
</div>
<div class="menu-item"><a href="../ref/Constraints/maxSize.html">maxSize</a>
</div>
<div class="menu-item"><a href="../ref/Constraints/min.html">min</a>
</div>
<div class="menu-item"><a href="../ref/Constraints/minSize.html">minSize</a>
</div>
<div class="menu-item"><a href="../ref/Constraints/notEqual.html">notEqual</a>
</div>
<div class="menu-item"><a href="../ref/Constraints/nullable.html">nullable</a>
</div>
<div class="menu-item"><a href="../ref/Constraints/range.html">range</a>
</div>
<div class="menu-item"><a href="../ref/Constraints/scale.html">scale</a>
</div>
<div class="menu-item"><a href="../ref/Constraints/size.html">size</a>
</div>
<div class="menu-item"><a href="../ref/Constraints/unique.html">unique</a>
</div>
<div class="menu-item"><a href="../ref/Constraints/url.html">url</a>
</div>
<div class="menu-item"><a href="../ref/Constraints/validator.html">validator</a>
</div>
<div class="menu-item"><a href="../ref/Constraints/widget.html">widget</a>
</div>
</div>
</div>
<div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Controllers</h1><div class="menu-sub">
<div class="menu-item"><a href="../ref/Controllers/Usage.html">Usage</a></div>
<div class="menu-item"><a href="../ref/Controllers/actionName.html">actionName</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/allowedMethods.html">allowedMethods</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/bindData.html">bindData</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/chain.html">chain</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/controllerName.html">controllerName</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/defaultAction.html">defaultAction</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/errors.html">errors</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/flash.html">flash</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/forward.html">forward</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/grailsApplication.html">grailsApplication</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/hasErrors.html">hasErrors</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/header.html">header</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/namespace.html">namespace</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/params.html">params</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/redirect.html">redirect</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/render.html">render</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/request.html">request</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/respond.html">respond</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/response.html">response</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/responseFormats.html">responseFormats</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/scope.html">scope</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/servletContext.html">servletContext</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/session.html">session</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/withForm.html">withForm</a>
</div>
<div class="menu-item"><a href="../ref/Controllers/withFormat.html">withFormat</a>
</div>
</div>
</div>
<div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Database Mapping</h1><div class="menu-sub">
<div class="menu-item"><a href="../ref/Database%20Mapping/Usage.html">Usage</a></div>
<div class="menu-item"><a href="../ref/Database%20Mapping/autoImport.html">autoImport</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/autoTimestamp.html">autoTimestamp</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/batchSize.html">batchSize</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/cache.html">cache</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/cascade.html">cascade</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/column.html">column</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/comment.html">comment</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/discriminator.html">discriminator</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/dynamicInsert.html">dynamicInsert</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/dynamicUpdate.html">dynamicUpdate</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/fetch.html">fetch</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/id.html">id</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/ignoreNotFound.html">ignoreNotFound</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/indexColumn.html">indexColumn</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/insertable.html">insertable</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/joinTable.html">joinTable</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/lazy.html">lazy</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/order.html">order</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/sort.html">sort</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/table.html">table</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/type.html">type</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/updateable.html">updateable</a>
</div>
<div class="menu-item"><a href="../ref/Database%20Mapping/version.html">version</a>
</div>
</div>
</div>
<div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Domain Classes</h1><div class="menu-sub">
<div class="menu-item"><a href="../ref/Domain%20Classes/Usage.html">Usage</a></div>
<div class="menu-item"><a href="../ref/Domain%20Classes/addTo.html">addTo</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/attach.html">attach</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/belongsTo.html">belongsTo</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/clearErrors.html">clearErrors</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/constraints.html">constraints</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/count.html">count</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/countBy.html">countBy</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/createCriteria.html">createCriteria</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/delete.html">delete</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/discard.html">discard</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/embedded.html">embedded</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/errors.html">errors</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/executeQuery.html">executeQuery</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/executeUpdate.html">executeUpdate</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/exists.html">exists</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/fetchMode.html">fetchMode</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/find.html">find</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/findAll.html">findAll</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/findAllBy.html">findAllBy</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/findAllWhere.html">findAllWhere</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/findBy.html">findBy</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/findOrCreateBy.html">findOrCreateBy</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/findOrCreateWhere.html">findOrCreateWhere</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/findOrSaveBy.html">findOrSaveBy</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/findOrSaveWhere.html">findOrSaveWhere</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/findWhere.html">findWhere</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/first.html">first</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/get.html">get</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/getAll.html">getAll</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/getDirtyPropertyNames.html">getDirtyPropertyNames</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/getPersistentValue.html">getPersistentValue</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/hasErrors.html">hasErrors</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/hasMany.html">hasMany</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/hasOne.html">hasOne</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/ident.html">ident</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/instanceOf.html">instanceOf</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/isAttached.html">isAttached</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/isDirty.html">isDirty</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/last.html">last</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/list.html">list</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/listOrderBy.html">listOrderBy</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/load.html">load</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/lock.html">lock</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/mapWith.html">mapWith</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/mappedBy.html">mappedBy</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/mapping.html">mapping</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/merge.html">merge</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/namedQueries.html">namedQueries</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/properties.html">properties</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/read.html">read</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/refresh.html">refresh</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/removeFrom.html">removeFrom</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/save.html">save</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/transients.html">transients</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/validate.html">validate</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/where.html">where</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/whereAny.html">whereAny</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/withCriteria.html">withCriteria</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/withNewSession.html">withNewSession</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/withSession.html">withSession</a>
</div>
<div class="menu-item"><a href="../ref/Domain%20Classes/withTransaction.html">withTransaction</a>
</div>
</div>
</div>
<div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Plug-ins</h1><div class="menu-sub">
<div class="menu-item"><a href="../ref/Plug-ins/Usage.html">Usage</a></div>
<div class="menu-item"><a href="../ref/Plug-ins/URL%20mappings.html">URL mappings</a>
</div>
<div class="menu-item"><a href="../ref/Plug-ins/codecs.html">codecs</a>
</div>
<div class="menu-item"><a href="../ref/Plug-ins/controllers.html">controllers</a>
</div>
<div class="menu-item"><a href="../ref/Plug-ins/core.html">core</a>
</div>
<div class="menu-item"><a href="../ref/Plug-ins/dataSource.html">dataSource</a>
</div>
<div class="menu-item"><a href="../ref/Plug-ins/domainClasses.html">domainClasses</a>
</div>
<div class="menu-item"><a href="../ref/Plug-ins/hibernate.html">hibernate</a>
</div>
<div class="menu-item"><a href="../ref/Plug-ins/i18n.html">i18n</a>
</div>
<div class="menu-item"><a href="../ref/Plug-ins/logging.html">logging</a>
</div>
<div class="menu-item"><a href="../ref/Plug-ins/scaffolding.html">scaffolding</a>
</div>
<div class="menu-item"><a href="../ref/Plug-ins/services.html">services</a>
</div>
<div class="menu-item"><a href="../ref/Plug-ins/servlets.html">servlets</a>
</div>
</div>
</div>
<div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Services</h1><div class="menu-sub">
<div class="menu-item"><a href="../ref/Services/Usage.html">Usage</a></div>
<div class="menu-item"><a href="../ref/Services/scope.html">scope</a>
</div>
<div class="menu-item"><a href="../ref/Services/transactional.html">transactional</a>
</div>
</div>
</div>
<div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Servlet API</h1><div class="menu-sub">
<div class="menu-item"><a href="../ref/Servlet%20API/request.html">request</a>
</div>
<div class="menu-item"><a href="../ref/Servlet%20API/response.html">response</a>
</div>
<div class="menu-item"><a href="../ref/Servlet%20API/servletContext.html">servletContext</a>
</div>
<div class="menu-item"><a href="../ref/Servlet%20API/session.html">session</a>
</div>
</div>
</div>
</div>
</div>
</td>
</tr>
</table>
<div id="footer">
Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
</div>
<script type="text/javascript" src="../js/docs.js"></script>
</body>
</html>