POSTing with commons-httpclient

POSTing with commons-httpclient

So, commons-httpclient is quite useful and easy for programming http operations, e.t.c. As their tutorial explains, you just create an HttpClient, then a PostMethod or a GetMethod and finally you have the client execute the method.
In the particular use case i was working on, i needed to post some data to a MS ASP 6.0 Greek Server – both the request and the response should be in windows-1253. After testing a simple get request and seeing it working, I thought it wouldn’t get any easier than that… and it didn’t!
When doing post (which is a requirement due to the size of the data), i kept getting all those weird chars, e.t.c. I tried
setRequestHeader("Content-Type", "charset=windows-1253");

but somehow, the server wouldn’t get my data this time.

So, anyway, to cut a long story sort (and probably save you the hours I lost), the key is to remember you’re doing a post (!), and do

 setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=windows-1253");
 

BTW, addRequestHeader("Content-Type", "charset=windows-1253"); wouldn’t work either.

Trip to Corfu – Bourlis wedding

Trip to Corfu – Bourlis wedding

Emily and I went to Corfu last weekend for a friend’s wedding – G. Bourlis!
I’ve known George a.k.a. Giozis and / or karaGiozis for the last 9 years, though he’s been living in Patra for some years now and we haven’t been able to keep in touch… But it’s always nice to see him.
So, the wedding was at 18:30, we started by car from Athens at 8:15 in the morning. Less than two hours later, we were near Patra, at the Rio-Antirio bridge. After a while, it really started raining + we took a wrong turn + we missed the ferry for Corfy for 3 mins… but we were just in time for the wedding.
There where so many people crammed inside that small village church, all waiting for the bride to arrive – and she was at least a half hour late… the happy groom didn’t mind waiting in the rain : )
Well, everything went as planned + the after-party was nice (live greek music included)! On the way back, we had the chance to see one of the bigest rainbows in our lives ( i’m mostly sleeping at day and it’s difficult to see those at night!!!)… it only lasted for 3 mins due to heavy clouds, but it was awesome.
All in all, it was a nice escape. I’ve made a flickr slideshow with all these – check it out.
Oh, and i’ve almost forgot, here’s a short video of the groom waiting:

More Tapestry sites

Here’s 3 more public Tapestry sites (using Dojo for ajax + javascript):

  • http://www.sourcekibitzer.org/ is … sourcekibitzer! It provides detailed programming metrics into the relevant code quality, member activity, individual developer know-how, and scope of open source projects. It’s using Tapestry 4.0.2 and Tacos and it has recently been open-sourced. You can have it running locally in 5 mins!
  • http://freebookie.org is a free internet bookmaker that uses the js effects and ajax that Tapestry 4.1.2 provides (via Dojo 0.4.3). The complete project is open-source, available from http://code.google.com/p/bookie and quite easy to setup and play with locally.
  • http://news247.gr is a high volume greek news site that’s constantly updated. It’s on Tapestry 4.1.3 and does persistence with iBatis

So, if you’re interesting in having a look at Tapestry, why not grab the source of freebookie or sourcekibitzer and hack’em around?

Cleaning a maven repo

Cleaning a maven repo

Just saw the size of my local maven repo… and it isn’t nice

So, I’m wondering, is there a maven goal that cleans up ‘obsolete’ files? I want files like old snapshot jars deleted … cause, if you depend on SNAPSHOT versions of projects that update often, you do end up with LOTS of them!