February 03

I prefer this Grails web framework, the Major has reached version 2. Given the wealth of new features, the 2 is more than justified before the dot. A good overview about what has changed, offers the article " What's new in Grails 2.0 "by Dierk König.

For me it was worth the new interactive Grails Console with TAB-completion, colored, one-line output and error output formatted the upgrade. It is primarily for the instruction execution is much faster because it does not own JVM must be started.
As a test candidate had my example Grails application grum (source code on Google Code ) serve. But as simple as a minor upgrade from one version to another was not.

The first thing that you should upgrade instructions internalize, because a simple grails upgrade resulted in me becoming one of inconsistent project in my development environment ( SpringSource Tool Suite ).

It is mostly to blame themselves, but where now are the pitfalls?

Dependency Management

One topic that I had ignored until now complete, was the dependency management. In previous Grails versions were all needed libraries (such as JDBC drivers) in the lib directory. Clean, it is natural to declare the dependencies. In Grails makes this into the buildconfig class.

conf / BuildConfig.groovy

  dependencies {
    / / Specify dependencies hereunder either
    / / 'Build', 'compile', 'runtime', 'test' or 'provided' scopes eg.

    runtime 'mysql: mysql-connector-java: 1.5.16'
    build "DisplayTag: DisplayTag: 1.2"
    runtime "DisplayTag: DisplayTag-export-poi: 1.2"
    runtime "DisplayTag: itext: 1.3"
    runtime "DisplayTag: poi: 3.2"
 } 

After that you should in the IDE via the Grails dependencies Tools -> Refresh Refresh Dependencies. If this is not (like me) it helps to stop the dependency management and launch it.

  • Grails Tools -> Disable dependency management
  • Grails Tools -> Enable Dependency Management

Alternatively, you can settle in the Grails console the following commands:

  grails> clean
 grails> was 

Plugins

It came with me to compile problems associated with the automatically installed plugins jquery and resources, I could only fix by reinstalling the plug-ins

  plugin-name > grails> uninstall-plugin <plugin-name>
 plugin-name > grails> install-plugin 'plugin-name> 

Taglibs

And where you have been cleaning up is. The day is createLinkTo depracted resources and should be replaced by the day. At this point one should also pay attention to upgrade the following notice:

If you install Resources (or it is installed automatically), the day will not write anything like <g:javascript> to the page until you add the <r:layoutResources/> tags to your layout.

Content Negotiation

One point is why I like Grails Sun, so that can be implemented very easily REST APIs. This has also changed in version 2.0 something. The content negotiation depends no longer on the accepted format of the responses, but by the content type of the request.
For this we must replace the code with format by request.withFormat. You can test this change with curl . For example, with:

  xml http: // localhost: 8080 / grum / contactData / list curl - header content-type: text / xml http:// localhost: 8080 / grum / contact data / list 

Conclusion:
The upgrade is worthwhile, even if it is connected with a little more work than usual

Links:
grum - Grails 2.0 Example application

gklinkmann written by \ \ tags: ,

May 25

This year's Jax (Conference for Java) has been a good 2 weeks past. Part of the lectures was videotaped and is now gradually with JAX TV channel available on Vimeo.

As always, were very interesting presentations from all topic areas below. For each Java flavor so there should be something.

gklinkmann written by \ \ tags: , , ,

Mar 18

Video - tutorials are in addition to a textbook is a good introduction to a topic. By SpringSource there on Grails two interesting tutorials on youtube .
If you are interested in the web framework Grails, you should take you half an hour for these two well-made video tutorials.

via:
New video tutorial on Grails - it-republik.de

gklinkmann written by \ \ tags: , , ,

Mar 14

I have neglected in recent times the topic Grails in this blog a bit. So it is now after this dry spell at the time, again to write a blog entry on this subject (may result in more).
One of my first article on Grails showed how to make Grails and Eclipse together. This entry was so successful that I did as a permanent site was built as part of a small tutorial on the blog.

This is a couple of months ago and support the creation of Grails applications with Eclipse has become steadily better.
Was it the beginning so that by far the best IDE for Grails was IDEA, the free Eclipse gets more and more. No later than the change of Grails developers to SpringSource and the associated integration into the Eclipse-based SpringSource Tool Suite (STS) , a lot has happened.

Aside from the main memory - Hunger of STS, I feel as old Eclipse users in good hands. With NetBeans and IDEA I could never really get used.

To enable Grails to support the Grails and Groovy on the Extensions tab extensions of the STS dashboards are installed (see screenshot). Then there are for Grails projects its own perspective, with syntax highlighting, code completion and a clear navigation in the Project Explorer.
In the toolbar there is a button in the Grails perspective Grails commands to execute (such as run-app ).

When installing the Grails Extensions is the installation directory of the current STS Grails saved version.

  springsource / ~> Ls spring / source
    grails-1.3.5
    grails-1.3.6				
    grails-1.3.7
    maven-2.2.1.RELEASE				
    roo-1.1.0.RELEASE			
    tc-server-devel-2.0.4.RELEASE
    sts-2.5.0.RELEASE 

Are there any updates (Help -> check for updates), a new version of Grails there is this added. In the Preferences (Groovy -> Grails) you have to take the new version of the workspace. The Grails project is still the upgrade command is necessary.

Conclusion:
The Grails integration into Eclipse has taken a big step forward. From IDEA functionality should still lead. Grails projects there are only supported in the paid version ULTIMATE.
The free development environment NetBeans and Eclipse-based STS hardly differ in the Grails support. Here the personal preference will decide on the IDE.

Links:
Talk about this topic on stackoverflow.com

gklinkmann written by \ \ tags: , , , ,

Mar 22

I've used a couple of hours to my hosted on Google Code project grum on the state of things to bring (it was indeed about time). Grum is a small Grails application for user management, enabling me to the web framework Grails 'to "play.

I'm aware of in implementing the many Grails plugins omitted in order to have as few side effects as possible and keep it for those simply looking for an introduction to Grails. Thus, included in Grum solutions, such as man:

  • access to a MySQL database implemented
  • 1:1, 1: n and n: m GORM modeled relationships
  • write your own tag libs
  • The JSP Tag Library DisplayTag used the data page by page, to group, sort, and in all possible formats (excel, csv, xml, pdf) to export
  • allows you to upload files
  • functional tests with the webtest plugin uses
  • and the delivery of XML based on specific URL's (short content negotiation) implements

The new version 0.3 now uses grails 1.2.1 and the plugin webtest in version 2.0.3. The source , the SQL files to create the MySQL database and a web archive has all the necessary libraries on Google Code to download ready.

Nutztungshinweise:
The code can be freely used, but may contain errors for which I assume no liability. The license conditions of the libraries it must be observed.

gklinkmann written by \ \ tags: , , , ,