Come in and join, if you're interested in using GWT with Grails.
Showing posts with label Grails. Show all posts
Showing posts with label Grails. Show all posts
16 November 2009
Grails GWT Google Group
There are lots of comments with questions below my Grails / GWT tutorial. Many people are also asking questions about GWT on the Grails mailing list. To move Grails / GWT related questions to single public place there's a Grails GWT Google Group now.
15 September 2009
Cool things with Grails URL mapping
In Grails you have a lot of nice features for doing web development. One of them is URL mapping with the link tag.This will map the URL 'http:localhost:8080/myapp/book/show/1' to the action show in the BookController class. To create such links you can use the link tag like this:This will tell Grails to map the URL 'http:localhost:8080/myapp/book/1' to the same show action as above, but what's happening with our link?
Now let's change our mapping again by adding:Well, now the above link will create the URL 'http:localhost:8080/myapp/books/2009' and everything else will stil work as expected.
Grails default mapping is this:
"/$controller/$action?/$id?" {}
<g:link controller="book" action="show" id="book.id">
${book.title}
</g:link>
Sure this is the standard way. But now lets change the URL mapping by replacing the default mapping:
"/$book/$id?"(controller: "book", action: "show")
It's stil working! Grails knows, that URLs, which are pointing to BookControllers's show action have to be of the declared structure and thus, the link tag will create a URL like 'http:localhost:8080/myapp/book/1'.
Ok, let's go on. What else can we do with this?
By default the URL 'http:localhost:8080/myapp/book/list?year=2009' will point to the list action of BookController and the URL parameter year will be available with
params.year
in the action. To create this URL you can use the link tag again:
<g:link controller="book" action="list" params="[year: "2009"]">
Books released in 2009
</g:link>
"/$books/$year?"(controller: "book", action: "list")
19 June 2009
GORM + JPA now available
I was waiting for this feature so long and now it's there:
GORM works with any JPA provider not just with Hibernate.
The first release of the plugin was just anounced by Graeme.
This is realy great news since the DuckWiki project can now make use of it. As a result, DuckWiki should work on each Java EE 5 app server without the need of having it's own (Hibernate) persistence layer.
As a key feature the awesome dynamic finder methods, provided by GORM, are also working, except on Google App Engine (look at this bug).
GORM works with any JPA provider not just with Hibernate.
The first release of the plugin was just anounced by Graeme.
This is realy great news since the DuckWiki project can now make use of it. As a result, DuckWiki should work on each Java EE 5 app server without the need of having it's own (Hibernate) persistence layer.
As a key feature the awesome dynamic finder methods, provided by GORM, are also working, except on Google App Engine (look at this bug).
09 June 2009
DuckWiki project started!
After the decision in the last days to start a new open source project, I've now created a repository on github.
Sure, there is no code in this repo but it will come soon. Some basic documentation will also follow in the next weeks.
So what is the project for?
Well it's name is DuckWiki and as you may expect, it will be a wiki software. It should be deveoped on top of the awesome Grails framework and make use of some cool new web technologies and architectures like RIA, REST, etc.
There are so much wikis, why another one?
Well the idea behind DuckWiki is not just creating a plain old wiki software to clone the Wikipedia. DuckWiki will be a wiki for creating DuckMaps instead of Wikipedia like articles.
DuckMap, what's that?
Everyone knows: It walks like duck, it looks like a duck, thus it's a duck, isn't it?
A DuckMap looks like a map and it behaves like one, thus it's one. But in general a DuckMap is like an instruction based on a cupple of maps (incl. maps or plans of buildings). You can think of it like a driving direction, but with much more details (even inside of buildings).
Sounds good?
Stay tuned.
11 November 2008
SpringSource has bought G2One
I just read it, but I'm not sure if it is realy true, what The Register writes today. G2One is the company of Graeme Rocher and the other guys behind Groovy and Grails. SpringSource is the company behind the awesome Spring framework, which is also the base of Grails.
Hopefully there will come a lot of benefit from this acquisition for Grails. My biggest wish is, that they will bring Grails to Spring Dynamic Modules for OSGi and thus onto a great OSGi infrastructure. This would also fix the most voted issue for Grails.
Hopefully there will come a lot of benefit from this acquisition for Grails. My biggest wish is, that they will bring Grails to Spring Dynamic Modules for OSGi and thus onto a great OSGi infrastructure. This would also fix the most voted issue for Grails.
05 June 2008
Grails/GWT Tutorial I - The first steps.
After someone was asking for a basic tutorial and samle application for using the Grails GWT plugin on the Grails mailing list, I've just written one.
You can read it under http://code.google.com/p/derjanandhisblog/wiki/GWTGrailsTutorial.
It should show you, how to create a domain model, a service for RPC calls and a very basic GWT client, which calls data from the Grails app and displays it.
Hopefully I'll find enough time to extend the tutorial and the application in the next weeks, to make it real book store ;-)
You can read it under http://code.google.com/p/derjanandhisblog/wiki/GWTGrailsTutorial.
It should show you, how to create a domain model, a service for RPC calls and a very basic GWT client, which calls data from the Grails app and displays it.
Hopefully I'll find enough time to extend the tutorial and the application in the next weeks, to make it real book store ;-)
22 May 2008
Grails is only Java EE with Spring
Grails is defintivly a cool framework for developing nice Java EE web apps. you can do a lot of tasks with just one step and the rest ist automatically done by Grails.
But using your existing Java code in a Grails application is no problem. Grails is based on Spring and Groovy and thus there are some easy ways to embbed Java code to your app.
To use it, you can put some Groovy code to the PROJECT_HOME/grails-app/conf/spring/resources.groovy file.
The following code shows you an example resources.groovy file:
Referencing this bean is the same as XML declared beans. Just put a
But using your existing Java code in a Grails application is no problem. Grails is based on Spring and Groovy and thus there are some easy ways to embbed Java code to your app.
- You can create a normal Grails controller or service and import your Java classes the normal way. This works pretty easy, if you're developing your app mainly with Groovy.
- If your app is allready based on Spring and thus provides allready Spring services, you can embbed'em directly and reference them in your Grails controller or services.
To use it, you can put some Groovy code to the PROJECT_HOME/grails-app/conf/spring/resources.groovy file.
The following code shows you an example resources.groovy file:
import com.duckmaps.server.imagerendering.services.ImageServiceImplHere you're seeing, that a bean with name imageService and the class ImageServiceImpl is defined. By setting the property scope to session, Spring instantiates this class for each session. It is important to put the import statement to the top. If you forget it, your code won't work.
beans = {
imageService(ImageServiceImpl) {bean ->
bean.scope = "session"
}
}
Referencing this bean is the same as XML declared beans. Just put a
def imageServiceto your controller and Grails will inject it like a normal Grails controller.
Subscribe to:
Posts (Atom)