JSP: Avoid creating a session

To avoid creating session when a JSP is accessed add the following page directive in the JSP.

<%@ page session="false" %>

MDC NullPointerException in WSAD debug


I was using the Log4J 's MDC class to store some values in the Thread for logging.
When I started my WAS Test Environment server in debug mode...
I received a NullPointerException in java.lang.InheritableThreadLocal.java (69)
The Source code for this class says...
66| public Object get() {
67|     Thread ourThread = Thread.currentThread();
68|     Map map = ourThread.inheritableThreadLocals;
69|     Object value = map.get(key);

After searching on the internet found that this is actually a bug in the JRE of WSAD.
The way around for this problem is to disable the "hot method replace" functionality in WSAD.

Link: Apache Mail archive link

CSS: The Road to Enlightenment

This is a very good site which explains how powerful CSS is.

CSS: Table row mouseover styles

This a lesson I learnt today.
My requirement: I have a table of data and I wanted to display a different background color when I move the mouse on any part of the row. So I defined seperate styles for the TR and TD tags. For the TR tag I also added onmouseover code to change the styleclass to a different one.
tr.datarow {background-color:white; color:black;}
tr.datarow-onmouseover {background-color:blue; color:white; cursor:hand; }
<tr onmouseover="this.className='datarow-onmouseover' " onmouseout= "this.className= 'datarow'" class="datarow"> 

Problem: Though the onmouseover is triggered when I move the mouse on the rows, it doesnt change the background color.
Solution: To change a property of TD on mouse over of TR then the property should not be overwritten in the TD styles. i.e. I 've defined a style for the TD tag also. And this style also contains background-color and color and properties. These are taking precedence over the TR properties.

In general, I think, in CSS if the parent and its child has same style property then overwriting the parents property does NOT overwrite the childs properties.