Thursday, 24 February 2011

FileUpload with multipart/form-data in Spring 2.5.x and Annotations

Firstly a qualifier, This is for Spring 2.5.x with annotations.
I have not had the pleasure of upgrading to Spring 3.X yet.

There is some excellent documentation on File Upload with Spring.

However for an annotation driven Controller it misses out one important step, namely the @InitBinder annotation.

public void initBinder(ServletRequestDataBinder aBinder) throws ServletException {
// to actually be able to convert Multipart instance to a String
// we have to register a custom editor
aBinder.registerCustomEditor(String.class, new StringMultipartFileEditor());
// now Spring knows how to handle multipart object and convert them

Thursday, 17 February 2011

Chrome and Grouping/Organising tabs

Do you find that you end up with loads of tabs open for several different subjects, and not wanting to close them......just yet.

Well today I found this chrome plugin for grouping tabs. It is something I have wanted for a while.

It is not quite as funky as Forefox's soon to be released Release 4 Tab Organising but it does the job nicely.