views:

1037

answers:

3

I am using springMVC and hibernate in my current j2ee project. The view as of now consists of plain jsp, with JSTL to make things a bit simple.

Looking at the extjs project, I believe it can be used as a substitute for the view. I have been looking at the extjs docs but frankly, I am not sure how to integrate it in spring.

Does anyone have any tutorial, blog, books recomendation, to get me started on this?

Or on the other hand, if extjs would be better managed from a different java MVC framework, then please suggest the same.

+2  A: 

Here is an example of a ProgressBar Pager integrated with Spring 3.0

It Demonstrates that Ext JS provides a helper class, XMLStore, which is automatically configured with an XMLReader which is used to read data from server.

It uses Xstream from codehaux for serialization to XML.

XStream is easily configurable with annotations,

Take a look at the Complete tutorial Here

Narayan
can't thank you enough for the link to the tutorial :)its making some sense now at last.
Sujoy
No Problem! Glad it helped =]
Narayan
+2  A: 

I like to use Spring views to return JSON data. Requests arrive and handled by a ThrowAwayController or MultiActionController or annotations (depending on the version of Java) which eventually passes a model to a JsonView. There are libraries/packages that create JSON from Java objects - I recommend using one. The client is a single page web-app - generated from JavaScript when the site initially loads - and it makes requests to the server (as described above) in response to user requests. JSP and JSTL are not discarded entirely, but their role is less important.

Upper Stage
I did the same thing and it works great.
rodrigoap
So essentially, its all ajax, if I understood your answer correctly.I am really confused about the controller structure though, do I use only one controller? Since, its a single page web-app! Or is there multiple controllers just like a normal springMVC webapp, only they all pass data to the same view? Sorry to bother, but a link to an explanation would be nice :)
Sujoy
With Java 1.4, we used MultiActionControllers - several, one per functional area. When the controllers became too large, we broke them apart. Eventually, we migrated to ThrowAwayControllers - one per request. Annotations allow any controller to serve any request. Furthermore, we create one view for each JSON response to be returned. Creating a JSON view should be VERY easy when you extend JsonView. Sometimes (perhaps rarely) you might use JSP and JSTL as your view - just be certain to generate and return valid JSON.
Upper Stage
many thanks for the explanation, though I accepted the other answer, cause the code in the link really cleared up a lot of my doubts
Sujoy
Best of luck to you!
Upper Stage
+1  A: 

Hello,

You can have a look on http://www.jprovocateur.org (Spring + Hibernate + Ext J.S) that allows the configuration of the ext j.s views(forms and grids) using xml.

Regards, M.

Michael