August 2017
Intermediate to advanced
142 pages
3h
English
© Jorge Acetozi 2017
Jorge Acetozi, Pro Java Clustering and Scalability, https://doi.org/10.1007/978-1-4842-2985-9_17
Jorge Acetozi1
(1)São Paulo / SP, Brazil
In this chapter, I illustrate how easy it is to work with REST endpoints in Spring MVC.
On the client side, you just create a JavaScript object called newChatRoom, convert it to JSON format, and send a POST request to the /chatroom endpoint. If it succeeds, then the success callback is called, and it appends the new chat room to the grid by manipulating the Document Object Model1 (DOM).
function createNewChatRoom() {var newChatRoom = {'name' : txtNewChatRoomName.val(),'description' : txtNewChatRoomDescription.val()};$.ajax({type : "POST",url : "/chatroom", ...
Read now
Unlock full access