ExtJS MVC SpringMVC - Ext JS 4 Spring MVC CRUD example

Ext JS 4 Spring MVC CRUD example

Posted on

ExtJS MVC SpringMVC - Ext JS 4 Spring MVC CRUD example

In my last post on ExtJS 4 MVC, I have demonstrated the use of ExtJS 4 MVC to create a simple Create-Read-Update-Delete application using ExtJS only. Today we will go to see how to use that ExtJS part for UI and use Spring MVC to manage the books records on server side using spring.

Let first start by creating Spring’s WebMVC configurer class. I am using spring’s new xml-free approach and if you are new to it, I recommend you to please go through my previous post.

Create a Book bean now, this bean is work as a Value Object and represent a single record in grid.

Now create a BookDao interface and implement it.

To make it more simple, I am using book list but you can extend it to save it relational table. See my SpringMVC-Hibernate GRUD tutorial for more details.

Now it’s time to create a Book Controller.

ExtJS code looks similar to previous example with a little change. I have changes the local store to server ajax proxy and after each delete/add/update operation, we will load the all record from server to make grid update.

Output:

Open the HTML file in any browser, the Output will look similar to below. You can click to add new Book record in GRID.

ext js crud - Ext JS 4 Spring MVC CRUD example

Download Source (without jars, size 27 kb)

Download WAR file (size 5.20 Mb)

Source techzoo.org