In this post I will present how you can format and send automatic emails with Spring and Velocity. Spring offers alone the capability to create simple text emails, which is fine for simple cases, but in typical enterprise application you wouldn’t want to do that for a number of reasons:

  • creating HTML-based email content in Java code is tedious and error prone
  • there is no clear separation between display logic and business logic
  • changing the display structure of the email requires writing Java code, recompiling, redeploying etc

Typically the approach taken to address these issues is to use a template library such as FreeMarker or Velocity to define the display structure of email content. For Podcastpedia I chose Velocity, which is a free open source Java-based templating engine from Apache. In the end my only coding task will be to create the data that is to be rendered in the email template and sending the email.

Continue Reading ...

In this post I will present how to quickly add a “Categories” entry to the menu of a WordPress standard theme. Because I am by no means an expert in WordPress and PHP yet, I wanted to avoid having to customize anything.

So here’s the trick:

In the Dashboard > Appearance > Menus section add a new entry under Links with the URL set to “#” and Link Text set to “Categories”. Once you’ve done click Add to Menu and then from Categeories pull and drop in the Menu Structure the ones you want displayed as sub-items under the newly created entry.

Continue Reading ...

Since the source code for is now open on GitHub for everyone to have look at and contribute to, I might as well add a ribbon on the website celebrating that. After a short research on the web, I stepped over Simon Whitaker’s project github-fork-ribbon-css which I could easily integrate in  the website:

GitHub ribbon

Octocat Source code for this post is available on Github - is an open source project.

In this post I’ll present the two simple steps required for that:

Continue Reading ...

How to display element in JSP only if model element not null

To do that you can use the or _ tags to make conditional rendering in Java Server Pages (JSP) using the JSP Standard Tag Library (JSTL) like in the following code snippet:

	<c:if test="${not empty podcast.twitterPage}">
		<a href="${podcast.twitterPage}" target="_blank" class="icon-twitter-producer producer-social"></a>
	<c:if test="${not empty podcast.fbPage}">
		<a href="${podcast.fbPage}" target="_blank" class="icon-facebook-producer producer-social"></a>
	<c:if test="${not empty podcast.gplusPage}">
		<a href="${podcast.gplusPage}" target="_blank" class="icon-google-plus-producer producer-social"></a>
</div> on GitHub

We use currently for a MySQL database and because we’ve recently gone open source on GitHub, we’ve created a to explain the setup of the database. The content of that file is basically reproduced here, as “back-up”, for future reference and why not?, it might also serve others in the mean time.

Note: Although the steps presented here refer to the database backing, they should be valid for any MySQL database you might want to setup either in Linux or Windows.

Continue Reading ...