20 December 2012

Model in Spring MVC

you can use the model items like ${modelitem} but you had to put the modelitm in the model prior to that, something like model.put(modelitem, "this is modelitem")

Rule of thumb when you need to manipulate data in your MVC application:
Try looking into the referenceData method in your controller, this is the main method grabbing data from resources and adding them into the model object. Look for something like:

@SuppressWarnings("unchecked")
@Override
protected Map referenceData(HttpServletRequest request, Object command,Errors errors) throws Exception

13 December 2012

Tree command in Mac

The one thing that I was really missing in Mac was the tree command line. If you are a terminal addict and a developer, you are among those with high probability of using this in linux. However, in Mac you don't have the option (it is not built-in). But there is always hope, you can follow the instructions on this post and have your tree command working.



Update: Kevin mentioned in google+ that it is pheasible (and might be even easier) to use Macports (or homebrew) to install the tree command. 

12 December 2012

JndiLoginInitialContextFactory & JBoss

JndiLoginInitialContextFactory is not working with JBoss >5. It worked with earlier version though. JBoss ignores the credentials for that.

7 December 2012

Google is closing down its free Apps. Wait, not for its (loyal) old customers!

One of the hot topics of Technology world today was about Google Apps. Google is shutting down its free Apps offering for small businesses. I am using Google Apps but I didn't know if it was small business account or something else that I was using. Looking into the Google Apps website, you won't no longer see any free option from today either. So I was looking on any piece of page I can find on internet to find out what will happen to my Google Apps service. I finally found this post on google enterprise blog saying the Free Apps won't be affected. However, the link was not working at the time of posting. Later that day I got an email from Google saying:
Starting today, we're no longer accepting new sign-ups for the free version of Google Apps (the version you're currently using). Because you're already a customer, this change has no impact on your service, and you can continue to use Google Apps for free.
Reading this comforted me. I never expected Google to make a free service to become fee based and force its users to pay. It is really nice of them to let those free Apps users keep their account. Otherwise I was looking for at least 50$ a year, or most probably getting my own hosting (for double that price of course) but with many additional options.

This reminds me of the time Google bought Feedburner and somehow messed up some feedburner feeds' names. Apologizing its customers, it sent them a nice package of mouse and pen. The package was not that important but the move; showing how much they appreciate their customers.

3 December 2012

Constraint vs. Trigger

Have you ever wondered which one to choose if you want constraint(s) to be forced on data? You can achieve your goal by using Triggers or Constraints (or even both). But the questions is which one to choose, and which one is better to use? Shall one go with Constraint all the time or pick Triggers every now and then? The relief is that there is a simple answer to that. Try to use constraints if you can. Constraints are "closer" to databases. Constraint are relational restriction you are setting for your data, and if you are using a relational database it is always best to use them. As all we know databases nowadays do more than just storing data and retrieving them, they perform optimization on queries as well. Defining constraint in your database, which is a relational principle, will give another chance for your database to deal with performance issues.

For more discussion head to this page: Performance consideratinos for Triggers vs Constraints