Monday, April 20, 2009

Tip: Velocity

If you are using the #if #else #end construct provided by Velocity, remember to put a space after the #else. If you don't, Velocity will ignore the #else and consider the statement to be a simple #if #end.

Thursday, April 16, 2009

Use BigDecimal for financial calculations

It is common to use the Double object or the double primitive type for financial calculations. Since you have no control over rounding behavior, mistakes may arise in your calculations. You might charge customers more (or less) than they owe. Use BigDecimal to solve this problem. For a clear, thorough explanation, see this document.

Monday, April 6, 2009

Tip: Tomcat startup exception

If, while starting up Tomcat, you get this error - SEVERE: Exception loading sessions from persistent storage - try to delete the SESSIONS.ser from your $CATALINA_HOME/work directory.