Automatically serialize POJOs to and from JSON

posted 22-Apr-2009 | 2 comments

The best tool I’ve found so far to serialize POJOs to JSON (and back again) is XStream, it’s automatic, simple and elegant, check it out.

Read more »

Paginated lists made really easy (part 2 of 2 – back-end)

posted 27-Oct-2008 | 2 comments

In our first installment we reviewed the front-end part of developing a paginated list using AJAX and Java. Now we will dive into the back-end of our pagination mechanism.

Read more »

Setup your web server to properly serve MS Office 2007 files

posted 20-Oct-2008 | no comments

Most web servers are missing the new MIME types needed for Office 2007 files (docx, xslx, etc.) and when you server one of this files from your web application the users browser typically tries to open them as ZIP files.

Read more »

Download a file using Java

posted 10-Oct-2008 | 6 comments

Download a file using Java from a URL should be a simple task, well it is :P. If you just don’t want to think too much about it here is a sample method to do it.

Read more »

Simple & nice Javascript date picker

posted 2-Sep-2008 | no comments

Check it out at http://www.styledisplay.com/mootoolsdatepicker/, it’s quite simple to use and looks great.

Read more »

Paginated lists made really easy (part 1 of 2 – front-end)

posted 14-May-2008 | 5 comments

You have to display a list of items in a web application, for each item allowing several operations (ie modification, deletion, etc.). The list can potentially be quite long, so pagination is required.
This scenario is common in backoffice web applications and public web sites, be it for administering information or as search results display, etc.

I’ll describe a simple way to implement a lightweight pagination engine that minimizes load on the server and gives the user the better experience possible. In this first installment I’ll focus on the front-end side, describing how to lay out the HTML, load it using AJAX and implementing the basic operations the user needs to navigate in your paginated list.

Read more »

AJAX autocomplete

posted 17-Apr-2008 | 5 comments

Using a nice AJAX auto completable input box is much nicer (for the user) than a combo box with 100 options. If you use jQuery, you may use a quite easy yet powerful plug-in called jquery.autocomplete (original, eh?). Grab it at http://www.pengoworks.com/workshop/jquery/autocomplete.htm.

Read more »

Long fields breaking your HTML?

posted 6-Apr-2008 | no comments

I guess in more than one time you needed to display some text in a space where it not always will fit. For example graphical designers love to lay out lists and tables and purposely forget about how long each field will really be ;)

A solution I like is to display always a fixed number of characters and add the full text as a title (mouse over display). A really easy way to do this is using the substring function from the JSTL functions library, for example:

<span title="${myBean.myProp}">
${fn:substring(myBean.myProp,0,25)}
</span>

Read more »