Monthly Archives: September 2013

Spring Insight

Just learned about Spring Insight, a technology that allows us to see the runtime performance of our applications. Demo by SpringSource YouTube Channel: At 3:17 he shows how to enable insight by using the insight tab, however my 3.0.0 version

Posted in Spring

CSS Frameworks

There’s so many CSS & Javascript frameworks to choose from: 960 gs  – 12 & 16 columns grids based on 960 pixel layout BluePrint – Another grid based CSS System Yahoo YUI – Javascript & CSS Library BootStrap – Front

Tagged with: , ,
Posted in CSS, Web

Setting up SSL

SSL serves two purposes : Encryption – data is encrypted with SSL before being sent using HTTP Authentication – the Certificate Authority guarantees the certificate holder is who they say they are First Step is to create a Self Sign

Posted in Java, Maven, Spring Security

Maven Overlays

Maven Overlays can be used to: Share common resources across multiple web applications Normal <dependencies> go to WEB-INF/lib However war <dependencies> are over-layed on the war project itself Need to specify type : <type>war</type> Wars & Zip files can be

Posted in Java, Maven

@InitBinder

Today we look at @InitBinder annotation. This can be used to set and invoke a custom Validator (Note: Don’t try and mix this with @Valid / JSR303 – the Bean Validation annotations). In essence it allows us to replace this

Posted in Spring, Spring MVC

Unit Testing

Mockito is a mocking Framework <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-all</artifactId> <version>${mockito.version}</version> <scope>test</scope> </dependency> It allows us to easily mock objects: mock(MyService.class) //using mock static method or @Mock +  MockitoAnnotations.initMocks(this); We can specify the desired behavior of the mocks using Mockito’s fluent APIs:

Tagged with: , ,
Posted in JUnit, Mockito, Testing

Maven – exec plugin

Use the exec plugin to execute a Java class. Setup on command line: exec.mainClass – Class with main method exec.args – (optional) command line arguments OR Setup through XML. <plugin>     <groupId>org.codehaus.mojo</groupId>     <artifactId>exec-maven-plugin</artifactId>     <version>1.2.1</version>     <configuration>       

Posted in Java, Maven