PDA

View Full Version : integrate Extjs with grails



ffzhuang
2 Dec 2008, 8:59 AM
We just write something for using extjs with Grails, you can view link @ this

http://ffzhuang.blogspot.com/2008/06/integrate-grails-with-extjs.html

Maybe it will help you to quick move forward (if you use grails).

Regards!

Fenqiang Zhuang

aconran
3 Dec 2008, 1:54 PM
Great post!

I've recently playing with Groovy and Grails. It is very easy to integrate with an Ext application and things tend to go together a lot quicker than with Java.

ffzhuang
3 Dec 2008, 7:55 PM
Ya, aconran:

I like Grails, it save me lots of backend code. It is amazing. I am pretty impressed that I do not need write config file, and I am only need create POJO object. And Grails can understand this function:

findAllByLastNameAndFirstname('"Kim", "davie")

And it can talk very well with extjs through JSON. Unbelievable

Thanks for your reply. Hopefully we can share more in the near future

Regards!

Fenqiang Zhuang


Great post!

I've recently playing with Groovy and Grails. It is very easy to integrate with an Ext application and things tend to go together a lot quicker than with Java.

Arindam Das
8 Feb 2011, 11:59 AM
Hello There,

I want to keep using the gsp pages for various reasons (for e.g. i want to be able to render a link if the user has a specific permission and use grails security plugin tag libs for that). Now I can't think of mixing javascript and gsp code in a clean way. Can anyone point me in the right direction. In your attempts to integrate ext and grails, have you completely done away with the gs pages.

-Arindam

alien3d
9 Feb 2011, 12:56 AM
It's grail so nice code structure ?So cool.I never know that....:-?

ffzhuang
10 Feb 2011, 8:55 AM
With Grails, it saved me lots of time. I did switch from Spring + hibernate to Grails @ 2008 - and using it until now. Personal I feel really comfortable to use Grails + extjs. The best structure to build web application as I know. And UI level is totally extjs format, backend is grails which generate JSON format data. Really neat. Any issue, just post in here, I can try to answer if I have solution.

Regards!

Fenqiang Zhuang


It's grail so nice code structure ?So cool.I never know that....:-?

csextjs
10 Feb 2011, 10:14 PM
Hi, ffzhuang

Thanks for offering help on Grails.

How do you send a session timeout message via json in Grails?

First I would think you will need a way to intercept client's
request and check for session timeout. I was playing with Filter but
could not find any acceptable solution.

Do you have any solution to this?

ffzhuang
11 Feb 2011, 8:26 AM
Hi, CSextjs:

We have done this 2 ways:

1: If you use Acegi (we use it), so in the loginController:

======
def authAjax = {
nocache(response)
// return Ajax response
def json = [success : "false", info : "relogin"]
render json as JSON
}
======

Return a relogin json if session expired, so you UI level get this information and need handle it. For example, popup a relogin window.

You can see our example, after login to our CubeDrive.com site, open word, enter something, SAVE it. Clean your browser cache, SAVE again. Now a relogin page popup, after your relogin, everything ok then.

2: If you do not user Aceigi, you need write GeneralController which extends by any controller. And you can include a method there which will return same thing as json format like above.

This is our solution - not perfect but work.

Regards!

F Zhuang


Hi, ffzhuang

Thanks for offering help on Grails.

How do you send a session timeout message via json in Grails?

First I would think you will need a way to intercept client's
request and check for session timeout. I was playing with Filter but
could not find any acceptable solution.

Do you have any solution to this?