Monthly Archives: May 2015

Use WebSockets with Spring, SockJS and Stomp

This guide walks you through the process of creating a "hello world" application that sends messages back and forth, between a browser and the server. WebSocket is a very thin, lightweight layer above TCP. It makes it very suitable to use "subprotocols" to embed messages. In this guide, we’ll dive in and use STOMP messaging with Spring to create an interactive web application. Maven Dependencies First, we need to add the Spring messaging modules in the POM file: Spring MVC Configuration Next, we need to add the message broker config to the Spring MVC config XML file. The main thing here is the setup of the message broker for handling the message exchange between the server and its clients. This is…

Continue Reading

Spring MVC MyBatis Integration Tutorial

Last few months, I'm working on a project with Spring MVC and Hibernate. Now, I want to try MyBatis. In this article, I'll tell you how to useMyBatis with Spring MVC. According to Wikipedia, database transactions should provide an “all-or-nothing” proposition, stating that each work-unit performed in a database must either be completed in its entirety or have no effect whatsoever. Further, the system must isolate each transaction from other transactions, results must conform to existing constraints in the database, and transactions that complete successfully must get written to durable storage. So in this example, I'm trying to create a simple MyBatis database transaction, managed by Spring Framework. Okay, so this is my pom file, as you can see, I'm…

Continue Reading
Contact Us
  • Nanyang Technological University, Singapore
  • root [at] haozhexie [dot] com