The "Now Playing" box in the bottom of the sidebar is displaying a random song from a PostgreSQL database table filled with song, artist and album informations extracted from my MP3 collection. To read the song informations I used a custom Java application that I pointed to the root directory of the MP3 collection: using the Java ID3 API the application builds a CSV file with title, author and album data extracted from the ID3 tags of each file, and the CSV file is then manually transformed into a series of SQL insert statements.

To actually show a random song, the sidebar contains a WebWork <ww:action> tag that via the iBATIS framework executes the following query in the PostgreSQL database:
select id, artist, album, title, artist_url, album_url
  from SONGS
  order by random()
  limit 1 offset 0
The order by random() clause gives the random ordering to the result set, and the limit 1 offset 0 clause takes only the first row from the random-ordered result set. Since the SONGS table will get larger and larger with time, the abovementioned WebWork action caches the result in the webapp scope for 10 minutes. This means that all the users that come within a given time window will see the same song.

Almost forgot to mention... The sidebar is added to the main content column with a SiteMesh decorator, and each section of the site has its own decorator. This results in a little hardcoding of paths in the decorators.xml file, but it's a very small price to pay for the flexibility gained in the HTML coding.