Jump to navigation. For me, the only real downside to building something in Grails is that the documentation tends to move quite a bit more slowly than the code. This is especially true for the learning materials that exist outside the reference documentation. And since I have a number of Grails 2 applications that need to be moved to Grails 3, what I really need is a guide to Grails 3 for Grails 2 developers. I blew through this part a little too quickly the first time being totally honest, the first three or four times , and two things I missed were:. The next section of this page is entitled 3.
|Published (Last):||24 April 2007|
|PDF File Size:||4.79 Mb|
|ePub File Size:||1.34 Mb|
|Price:||Free* [*Free Regsitration Required]|
Jump to navigation. For me, the only real downside to building something in Grails is that the documentation tends to move quite a bit more slowly than the code.
This is especially true for the learning materials that exist outside the reference documentation. And since I have a number of Grails 2 applications that need to be moved to Grails 3, what I really need is a guide to Grails 3 for Grails 2 developers.
I blew through this part a little too quickly the first time being totally honest, the first three or four times , and two things I missed were:. The next section of this page is entitled 3. As far as I can tell, this was meant more to assist users of plugins to upgrade those plugins from Grails 2 to Grails 3 than to assist plugin developers.
Nevertheless, there is some good basic information here about how Grails 3 uses Gradle , the nice Groovy-based build tool, so I suggest reading it in any case. Finally, the patient reader arrives at 3. Here is where the fun starts. The documentation states that a good way to start is to first "create a new Grails 3 application using the 'web profile. To cut short the silliness, I like to think of the Grails 3 "web profile" as the configuration closest to the old standard Grails 2 configuration.
That application might have been created back in the day using a command like:. This would have created a project folder called cms , and all the domain and controller classes would appear in. So use the same create command to generate the same package structure.
Let's say you noticed that customer management systems are these days called "customer relationship management" systems or CRMs.
So you're going to create the new version with this command:. Sharp-eyed readers might also have noticed that the above instructions create a too-deep file structure. For our hypothetical example, we should do the following after issuing the create-app command :. This is a good moment to move UrlMappings. Step 3 in the upgrade guide is pretty self-explanatory, if somewhat terse. Based on my experience, I would suggest adding as little as possible here. But things like famfamfam , maybe not.
I ended up changing the version number though perhaps I should have left it as "0. Instead, the actual JQuery stuff is managed by the Grails 3 asset pipeline. And if your Grails 2 is old enough that it is using resources rather than the asset pipeline, then here's another new thing to learn about.
Basically, the suggestion is to include these two lines in your GSP header:. Well, almost. There are other options, including linking to a content delivery network CDN or actually including the libraries in the header directly. Step 4 mentions, in a hasty way, the choice of application. Eventually—after some trial and error—I decided to go with adjusting a brand-new application. In my case, the only thing I had to change were the lines that defined my database connection, under datasource: and environments:.
In particular, the lines. The other thing I wonder about in my application. It seems to me that the default package should be "com. If like me, you decide to change the package name, there are basically two problems to solve. The first is the directory structure: Following our example, if the domain classes were originally in.
My first migrated application is a reporting site for clients and so is primarily read-only from their perspective. All the data maintenance is done by a few trusty clerks. That being the case, the Grails 2-generated CRUD was pretty effective as a starting point for the data maintenance framework. The create. In the Grails 2 files, the line. The former lines did not seem to actually cause the save to occur, nor did they redirect to the show.
I speculate that this is due to the absence of the "method" parameter. Strangely, the "resource" parameter is not documented, even in the relevant Grails 3. So how did I learn about this? Simple—I built a sample application from the ground up, created a domain class, and generated controllers and views for that domain class, and the views used the "resource" parameter.
I should mention for completeness that the Grails 3 CRUD uses a new tag library rather than GSP forms to achieve the rendering of the instances, but the old form technology seems to work fine. The big surprise for me was an apparent change in the meaning of the Transactional directive. For Core, this command:. Before running it, I saved my old User.
Some time back I decided to use a different name for the PostgreSQL tables holding User, Role, and UserRole data, so I had to insert the table name mapping into the new domain class definitions. I also put the configuration stuff for the mail plugin in application. After I had the application up and running, we discovered an interesting incompatibility with Tomcat7 the newest version available on our older server.
I had some code that delivered results in. CSV format using the following Groovy syntax:. It turns out that third line, appending the contents of converted to the output stream, created a vast problem for Tomcat7.
The solution, provided by a very kind person on StackExchange, was to wrap the last two lines in separate static methods and annotate them with CompileStatic. For more detailed info see the relevant discussion on StackExchange. First, despite the thinness in parts of the documentation, I was able to get to a working Grails 3 version of my application through a lot of trial and error, especially by creating a new sample application and studying the differences between it and my old code.
Third, I need to do a lot of testing and generally exercising the system now, and try to nail down those last few uncertainties along the way. Fourth, and to me foremost, I still really like Grails. Developers talk about a "batteries included" implementation for certain programming languages and frameworks; to me, Grails is "batteries, battery factory, lithium mines, and full regulatory approval" included.
Standing on top of the vibrant technology like Spring, all in a "convention over configuration" design, makes Grails powerful and downright fun to use. In sum, if you are maintaining a Grails 2 application, I encourage you to try moving it to Grails 3 to extend its longevity. Limited documentation made this upgrade a challenge. Here's what you need to know before you upgrade to Grails 3. Image by :. Get the highlights in your inbox every week.
Programming and development. RegisterController grails s2ui-override register com. Topics Programming. About the author. On the technical side of things, I have spent a great deal of my career as a consultant, doing data analysis and visualization; especially spatial data analysis. I have a substantial amount of related programming experience, using C, awk, Python, More about me. Exploring Algol 68 in the 21st century. When to choose C or Python for a command-line interface.
How to write a VS Code extension. Customizing my open source PHP framework for web development. Use this Python script to encode binary in Base Daniel Hammer on 16 May Permalink.
Great article! Only thing I'm missing; how exactly did you create your sample project used for comparision? Best regards, DH. Subscribe to our weekly newsletter Get the highlights in your inbox every week.
Upgrading a Grails 2 application to Grails 3
Proper way to stream file from controller
Search everywhere only in this topic. Advanced Search. Classic List Threaded. Michael Mallete.
Subscribe to RSS
- ENTROPY BY THOMAS PYNCHON PDF
- THINKING PHOTOGRAPHY VICTOR BURGIN PDF
- DESCARGAR UNA MECANICA SIN TALACHAS PDF
- FANTAISIE IMPROMPTU JOLIVET PDF
- ESPUMA LOS DIAS BORIS VIAN PDF
- HERMETIC MAGIC THE POSTMODERN PAPYRUS OF ABARIS PDF
- LA SCIENZA DEL NATURAL BODYBUILDING - METODO BIIO PDF
- DIN 54346 PDF
- CANTO A SU AMOR DESAPARECIDO RAUL ZURITA PDF