Category Archives: Web Technologies

No code REST services with Spring Boot and Spring Data REST

CRUD REST services are the backbone of a microservice architecture. If we want to use microservices rather than monolithic applications, it’s essential that we can create a basic service with a minimum of effort. Spring Boot can be used to quickly create and deploy a new web service. Spring Data REST can be used to build out the REST interface based on a database entity model. Using both together allows us to create a running RESTful web service with zero custom Java code and no tricky XML.

This how-to describes how to build a RESTful web service as an executable JAR that provides CRUD operations against a single MySQL database table.

WebSocket push notifications with Node.js

The Node.js website describes it as having “an event-driven, non-blocking I/O model that makes it lightweight and efficient”. Sounds lovely, but what’s it actually for?

Modulus’s excellent blog post – An Absolute Beginner’s Guide to Node.js provides some rather tasty examples. After covering the trivial examples (Hello world! and simple file I/O), it gets to the meat of what we’re about – an HTTP server. The simple example demonstrates a trivial HTTP server in Node.js in 5 lines of code. Not 5 lines of code compiled to an executable or deployed into an existing web server. 5 lines of code that can be run from a simple command. It then goes on to describe the frameworks and libraries that let you do really useful stuff.

This looks just the thing for implementing a new feature in the Spanners demo app: push notifications to all logged-in users when a spanner is changed.

Deploying to Tomcat 7 with Maven

It may be desirable to have Maven automatically redeploy the application(s) to a test server on builds. This may be useful in a Continuous Integration (CI) scenario where we want some system running the latest build.
In this example, we want Tomcat updated with the latest build whenever we put an updated build in the Maven repository.

MockMVC to test Spring MVC form validation

The MockMVC class allows tests to be run against a real Spring application context without actually having to run the complete application in a Servlet container

Integration Tests with Selenium and tomcat7-maven-plugin

To create an automated integration test of my spanners-struts webapp, I need a way of launching it as part of the Maven build process.

Protecting Service Methods with Spring Security Annotations

Any class or method can be protected with Spring Security using either AOP interceptors or expression based annotations on the class or method.

Preventing XSS Vulnerabilities in Web Frameworks

The protection offered by web frameworks is only useful if it is enabled. On several occasions I’ve seen developers explicitly disable the ‘safe’ output mechanisms provided by the framework.

Web service testing with soapUI

soapUI is an essential free tool for testing SOAP and other web service protocols. It was particularly useful for testing the SpannersWS demo as it works well with WSS.

Rounded corners in CSS / IE Tester

Fortunately IETester exists to quickly test web pages using the rendering engines of IE 5.5, 6, 7, 8 and the IE9 preview

Installing WordPress

A technical note on how to install WordPress on a desktop PC.