Episode 1: Home
After a long Christmas break, traveling, reading, playing with kids and eating my favorite Roberto's burritos (carne asada with the works: pico di gallo, guacamole, cheese and sour cream), it is time to return to the blog and give my best wishes of a happy New Year to all readers.
In the early days of the DHTMLX Java Tag library some developers of a large financial company asked me to give code examples with the Spring Framework. I have also received requests from blog readers to provide examples of using DHTMLX and Spring, so I am taking the opportunity to write a series (see also episode 2 , episode 3 and episode 4) of posts on the subject.
I have dug up my old examples, updated them to run with Spring 3.1, DHTMLX 3.0 and Google App Engine and packaged in a simple web application. Part of the DHTMLX Spring Adapter code presented comes from an open source library that will be included in the upcoming release (sometime in 2012) of the DHTMLX Java Tag Library.
I have dug up my old examples, updated them to run with Spring 3.1, DHTMLX 3.0 and Google App Engine and packaged in a simple web application. Part of the DHTMLX Spring Adapter code presented comes from an open source library that will be included in the upcoming release (sometime in 2012) of the DHTMLX Java Tag Library.
DHTMLX Server Side
As extension of the JavaScript component library DHTMLX delivers a free open source Java package (dhtmlxConnector) for server side integration. The connector provides all the functionality needed to integrate the major database servers. Below is a Java code sample to connect a dhtmlxGrid to a database table:
- /**
- * DHTMLX Grid Connector Example
- */
- public class BasicConnector extends ConnectorServlet {
- @Override
- protected void configure() {
- Connection conn= ( new DataBaseConnection()).getConnection();
- GridConnector c = new GridConnector(conn);
- c.dynamic_loading(100);
- c.render_table("table", "id", "field1,field2");
- }
- }
With the dhtmlxConnector you can have a working dhtmlxGrid in minutes if you have direct access to the database; however, the design of the connector does not allow you to get the same result in a environment where the persistence layer is based on JDO/JPA.
Spring MVC
In order to get the advantage of the many features that the framework offers, Spring developers adopt a well defined architecture. A typical basic Spring Web Application consists of a Model, Controller, Service and Repository.
Book.java- /**
- * Model
- */
- public class Book {
- private Long id;
- private String author;
- private String title;
- private Integer sales;
- private Integer price;
- }
- /**
- * Controller
- */
- @Controller
- public class BookController {
- @Autowired
- private BookService bookService;
- @RequestMapping(value = "/books", method = RequestMethod.GET)
- public void getBooks() {
- List<Book> books = bookService.getBooks();
- ...
- }
- }
- /**
- * Service
- */
- public interface BookService {
- List<Book> getBooks();
- Book getBook(String id);
- Book store(Book book);
- }
- /**
- * Repository
- */
- public interface BookDao {
- Book find(String id);
- List<Book> findByTitle(String title);
- Book store(Book book);
- List<Book> findAll();
- }
Request Mapping
Spring provides a powerful and flexible Java annotation for request mapping. There are many schools on the request mapping design. The table below highlight the URL mapping of the example application presented in the series:
URL
|
GET
|
PUT
|
POST
|
DELETE
|
/books
|
List books
|
NA
|
Create/Update book
|
NA
|
/books/id
|
Get book (id)
|
NA
|
NA
|
NA
|
DHTMLX Spring Adapter
The sample application of the series illustrates an approach how to integrate a Grid and a Form component with the Spring Framework. Below is the code example for the Controller class using the DHTMLX Spring Adapter.
BookController.java
- /**
- * DHTMLX Spring Adapter Example
- */
- @Controller
- public class BookController {
- @Autowired
- private BookService bookService;
- @RequestMapping(value = "/books", method = RequestMethod.GET)
- public GridAdapter getBooks(@RequestParam("c") String c) {
- GridAdapter adapter = new GridAdapter(c,Book.class);
- adapter.setData( bookService.getBooks() );
- return adapter;
- }
- @RequestMapping(value = "/books/{id}", method = RequestMethod.GET)
- public FormAdapter getBook(@PathVariable("id") final String id) {
- Book book = bookService.getBook(id);
- FormAdapter adapter = new FormAdapter( book );
- return adapter;
- }
- @RequestMapping(value = "/book", method = RequestMethod.POST)
- public FormAdapter storeBook(@Valid @ModelAttribute Book book, ...) {
- FormAdapter adapter = new FormAdapter(book,binding);
- if( adapter.hasValidData() ) {
- bookService.store(book);
- }
- return adapter;
- }
- }
Looks familiar, huh?
The series will cover many aspects of the integration of Spring and DHTMLX trying to get the best of both worlds, including client and server site validation, MVC architecture, and URL mapping best practice.
In the upcoming episodes I will go deep in the code, illustrating the design of the DHTMLX Spring Adapter. Below is the list of Sons of DHTMLX and SPRING episodes:
Episode 1: Home
Introduction to the DHTMLX Spring Adapater (this post)
Episode 2: Caregiver
Take care of your objects with client and server side validation (released 01/11/12)
Episode 3: Turning and Turning
Spring MVC annotation driven configuration (released 01/18/12)
Episode 4: Fruit for the Crows
Full Source code delivery (released 02/16/12)
Episode 5: Call of Duty
Get involved and contribute to the open source development (released 02/22/2012)
Stay Tuned!
Episode 5: Call of Duty
Get involved and contribute to the open source development (released 02/22/2012)
Stay Tuned!
i'm watting for each episode...
ReplyDeletegood stuff. looking forward to further postings from you.
ReplyDeleteExcellent idea! Kind sharing this blog. I am sure that reading your blog leaves the people with some good learning experience. Great job.
ReplyDeleteSpoken English Classes in Chennai
Spoken English Class in Chennai
Spoken English in Chennai
IELTS Training in Chennai
IELTS Chennai
Best English Speaking Classes in Mumbai
Spoken English Classes in Mumbai
IELTS Mumbai
IELTS Center in Mumbai
IELTS Coaching in T Nagar
Ah, there is a good discussion about this paragraph in this place on this website. I read all that, so now I am commenting here too... Qualified travelers to Turkey by filling an online form with their personal details can apply visa to Turkey and pay visa cost Turkey online.
ReplyDeleteinstagram takipçi satın al
ReplyDeleteinstagram takipçi satın al
takipçi satın al
takipçi satın al
instagram takipçi satın al
takipçi satın al
instagram takipçi satın al
aşk kitapları
tiktok takipçi satın al
instagram beğeni satın al
youtube abone satın al
twitter takipçi satın al
tiktok beğeni satın al
tiktok izlenme satın al
twitter takipçi satın al
tiktok takipçi satın al
youtube abone satın al
tiktok beğeni satın al
instagram beğeni satın al
trend topic satın al
trend topic satın al
youtube abone satın al
beğeni satın al
tiktok izlenme satın al
sms onay
youtube izlenme satın al
tiktok beğeni satın al
sms onay
sms onay
perde modelleri
instagram takipçi satın al
takipçi satın al
tiktok jeton hilesi
pubg uc satın al
Do you think to make a video about this code fo youtube? You could get many likes and views from this site https://soclikes.com/
ReplyDeleteWhat an outstanding post! “I'll be back” (to read more of your content). Thanks…. Indian tourist visa or eTV for India is an online travel authorization. Foriegn travelers whose sole purpose of visiting India is for leisure, sightseeing, religious work or casual travel to visit their friends or relatives can apply for Indian tourist visa through online India visa application system.
ReplyDeleteThe website is good and the stock is good. Thanks for all you do. Indian visa photo specifications, you can read all the guidelines related to Indian Visa Photo Specifications online through India Evisa Portal.
ReplyDeleteHi, I think this is very useful information. The article is inspiring me to have the same mindset as you. Are you interested in visiting India? Travel to India requires an Indian visa. I don't no about what is medical visa in India? I found this site & read the Indian e visa page and I got knowledge about medical visa India & requirements. Then apply through this site. It's really great service! I received my visa online within days. Amazing service and super helpful. I recommend it to everyone!
ReplyDeleteGood afternoon everyone. Great blog. Thanks for sharing. You know how many categories of India e-visa, you can get more info about electronic Indian Visa & India visa price via our India visa page.
ReplyDeletemmorpg oyunlar
ReplyDeleteinstagram takipçi satın al
Tiktok Jeton Hilesi
Tiktok Jeton Hilesi
Sac ekimi antalya
İnstagram Takipci Satın Al
İnstagram takipçi satın al
MT2 PVP
TAKİPÇİ SATIN AL
En son çıkan perde modelleri
ReplyDeleteSms onay
MOBİL ODEME BOZDURMA
Nft nasıl alinir
Ankara Evden Eve Nakliyat
TRAFİK SİGORTASI
dedektör
web site kurmak
Aşk Kitapları
Hi, you should continue your writing. I am sure you have a great readers’ base already! Are you planning to travel to Turkey and don't have a Visa? You need not worry because now you are just a click away. You can apply for Turkey visa urgently and select urgent if you want it soon.You can get your visa within the processing time of Rush applications which can take up to 1 - 4 hours.
ReplyDeletesmm panel
ReplyDeletesmm panel
iş ilanları
instagram takipçi satın al
hirdavatciburada.com
firmaportal.com
tiktok jeton hilesi
SMM PANEL
ReplyDeleteSmm Panel
iş ilanları
instagram takipçi satın al
hirdavatciburada.com
beyazesyateknikservisi.com.tr
servis
tiktok jeton hilesi
Hii guys,If you are interested to visit Pakistan then nowadays the Pakistan e visa process is online. The process is very simple if you have the right documents. First of all, check that you are a citizen of the eligible country and then apply for Pakistan visit visa. You can visit our e visa Pakistan website and get all the information here.
ReplyDeleteIt s a very useful page. Thank you. 50e2a4524fd452c849d8a82168076b37
ReplyDeleteumraniye
pinarbasi
nevsehir
abana
cihanbeyli
ciftlikkoy
akhisar
kumluca
bolvadin
It s a very useful page. Thank you. fc616d60d3be8bd68d1f4c642fb3875e
ReplyDeleteegil
cumayeri
gonen
bergama
cekerek
bodrum
kecioren
yalihuyuk
eskil
It s a very useful page. Thank you. d736584b7819b4b5336c3259a90bb6d8
ReplyDeleteharmancik
puturge
uzundere
uskudar
uzumlu
pinarbasi
sogut
alpu
altinova
Congratulations on your article, it was very helpful and successful. b3a37798ff9da3dffe38b29678574dbb
ReplyDeletenumara onay
website kurma
sms onay
Thank you for your explanation, very good content. d878d0e6bc2409c1abc9b84c6e7abe8a
ReplyDeletealtın dedektörü
elf bar
ReplyDeletebinance hesap açma
sms onay
İZ04
betmatik
ReplyDeletekralbet
betpark
tipobet
slot siteleri
kibris bahis siteleri
poker siteleri
bonus veren siteler
mobil ödeme bahis
747
güngören
ReplyDeletesakarya
fatih
adana
avcılar
4TO6Q1
bayrampaşa
ReplyDeletegüngören
hakkari
izmit
kumluca
VN4
salt likit
ReplyDeletesalt likit
WUQMHF
https://saglamproxy.com
ReplyDeletemetin2 proxy
proxy satın al
knight online proxy
mobil proxy satın al
XCPE5O
https://saglamproxy.com
ReplyDeletemetin2 proxy
proxy satın al
knight online proxy
mobil proxy satın al
V4P
bayburt
ReplyDeletebeykoz
beyoğlu
bilecik
bingöl
TXC
burdur
ReplyDeletebursa
çanakkale
çankırı
çorum
denizli
diyarbakır
4VQ
Eskişehir
ReplyDeleteAdana
Sivas
Kayseri
Samsun
603K0
yozgat
ReplyDeletesivas
bayburt
van
uşak
NBMDPY
istanbul evden eve nakliyat
ReplyDeletekonya evden eve nakliyat
düzce evden eve nakliyat
bursa evden eve nakliyat
diyarbakır evden eve nakliyat
QL0NK
EAEF8
ReplyDeleteNiğde Şehirler Arası Nakliyat
Silivri Çatı Ustası
Tunceli Lojistik
Mercatox Güvenilir mi
Etimesgut Fayans Ustası
Ünye Koltuk Kaplama
Sinop Lojistik
Batıkent Fayans Ustası
Eskişehir Parça Eşya Taşıma
BD26E
ReplyDeletereferanskodunedir.com.tr
195FF
ReplyDeleteGate io Borsası Güvenilir mi
Bitcoin Nasıl Kazanılır
Jns Coin Hangi Borsada
Gate io Borsası Güvenilir mi
Osmo Coin Hangi Borsada
Bitcoin Nasıl Para Kazanılır
Azero Coin Hangi Borsada
Luffy Coin Hangi Borsada
Binance Referans Kodu
7809E
ReplyDeletemexc
4g mobil
kaldıraç ne demek
canlı sohbet uygulamaları
bitexen
okex
güvenilir kripto para siteleri
kizlarla canli sohbet
bitcoin hesabı nasıl açılır
C3542
ReplyDeletegörüntülü show ücretli
9CFE8
ReplyDeletewhatsapp görüntülü şov