RSS Feed Subscribe to RSS Feed

 

Setting up a VPC in AWS

In the previous blog post, we created a simple HelloWorld example in AWS. We did the bare minimum (as any HelloWorld example should!) by taking advantage of a default VPC, Subnet, NACL, and Internet Gateway but, by necessity for our example, creating a custom Security Group.

In this tutorial, we will shy away from defaults and create a VPC from scratch. Again, this is done in the guise of HelloWorld.

(more…)

Tags: , ,

HelloWorld on an AWS EC2 instance

This is a basic “HelloWorld” tutorial for AWS EC2. We create an EC2 instance, enable the required access, and install Apache to serve a trivial HelloWorld html file.

 

(more…)

Tags: , ,

Kubernetes HelloWorld

This tutorial covers how to deploy a simple HelloWorld app on Kubernetes, and expose it externally (as you might for a UI service, for example).

I found setting up the Kube cluster deployment very straightforward, but making it externally accessible much trickier, however it boils down to just two commands:

    $ kubectl create -f boothello-deployment.yaml

    $ kubectl expose -f boothello-service.yaml

(more…)

Tags: , , , ,

Using Docker with a maven project

If you have a maven project, there are a plethora of ways to enable it to run within a docker container.

(more…)

Tags: , , , , ,

URL Encoding

URL encoding, also known as percent encoding, takes certain “reserved” characters and standardizes (or canonicalizes) them.

Why? This is normally done when transmitting data in html forms. For example, the # character has a special purpose in html (as an html anchor) and so is converted to make it clear that it is part of that data, not part of the html document where it is to be displayed.

Another (related) use is for prevention of XSS attacks. If your web page allows a user to enter text (for example, a comments box on a blog), it would be very easy for a motivated user to enter malicious text that will be interpreted as a script.

(more…)

Tags: , , , ,

Spring MVC Hello World with Continuous Deployment

Oh dear, yet another ‘Hello World!’. But although the functionality is trivial, this little SpringMVC project is complete enough for me to use as a template to bootstrap more complex projects. It consists of:

  • HTML/JSP client
  • SpringMVC server using a Controller/Service/DAO design
  • Maven for build and dependency management

This is an updated version of an older project I created, with the following enhancements:

  • Added a full suite of automated tests (unit, integration and browser based)
  • Added placeholders for JavaScript and images (both can be a little tricky to put in the correct place with SpringMVC)
  • Incorporated into a continuous deployment environment

More details below, but you can find the full source code on this GitHub repository

(Previously I had the code deployed on a CloudBees instance at http://springmvc.shaunabram.cloudbees.net, but CloudBees have since unfortunately shut down their free tier).

Read more

Tags: , , , , , , , , , , ,

Swing, Webstart and Maven – An Example

Following my introductory rant on the subject, this post is a working example of using Swing and Webstart with a multi-module maven project.

Complete source can be downloaded from here.
Read more

Tags: , , , , ,

Swing, Webstart, Maven – a difficult combination

I have spent the last few weeks struggling with a Swing app that I wanted to deploy via Webstart and build using Maven, via the the Webstart Maven Plugin. It has been a hugely painful process. I found the plugin documentation difficult to follow, struggled to understand the subtle config differences in jnlp, took longer than I expected to get jar signing working, had problems with webstart caching and suffered through a plethora of vague error messages. I found this posting where the author vowed to never use Webstart again, and I can empathize. Postings of people asking for help with Webstart problems certainly aren’t difficult to find. Using maven to build the jnlp provides some conveniences, but introduces new problems too. Overall, I’d prefer to avoid using a Swing/Webstart/Maven solution again.
Read more

Tags: , , , , ,

Spring MVC Hello World

There is a good Getting Started with Spring MVC blog post over on the Spring team blog.

I have created several Spring MVC projects for both work and play, and am attaching my own simple version of the HelloWorld example here, based on the Spring blog example.
Find my maven ready source here.
Like my previous JSP/Servlet example, I find these templates useful for getting prototypes up and running.

Tags: , , , , , ,