Thursday, November 13, 2008

Javascript tagName and labels

First of all, tagNames are always UPPERCASE! Secondly, when an event listener (onclick) is registered to an element, containing a label with its 'for' attribute set to a valid input id, click on that label will result in two events being fired: one for the label and one for the appropriate input.

Tuesday, November 4, 2008

Are you using getters and setters?

Then use them everywhere. I mean equals, toString, compare and other methods, belonging to the same class. Failing to do so might backfire any time you add some logic to the setter/getter (and I know, that getters/setters are considered an anti-pattern by some, but that's another topic).

Saturday, October 11, 2008

Eclimd doesn't see your workspace

Add
-Dosgi.instance.area.default=path_to_the_workspace
to the eclimd.bat run parameters.

Wednesday, October 8, 2008

Ibatis nested resultmap/select memo

Ibatis v. 2.1 : when using nested resultMaps you must put sqlMap namespace before the actual resultMap name. When using nested select - namespace isn't needed.

JSON-lib memo

JSON-lib library for java v. 2-2-2-jdk15. Uses java string quotes (double quotes) when serializing JSON objects to string.

Monday, September 29, 2008

Struts 1: Action to DispatchAction

In order to convert Action to DispatchAction, change the action name from 'execute' to 'unspecified' and add a 'parameter="something"' attribute to action node in struts.xml.

Tuesday, September 23, 2008

Mockito matchers

Configuration: Mockito 1.5, TestNG 5.8 jdk15, maven-surefire 2.4.2
Don't use mockito matchers (anyInt, anyString, ...) to 'mock' arguments for non-mocked/stubbed method calls. Using matchers this way can cause unpredictable test failures, as the state of matchers is being tracked statically (simpliest explanation I could come up with without digging into source). You might get an InvalidUseOfMatchersException in a test case different to the one matchers were used in.

Monday, September 22, 2008

LDAP and user rights

If, for some reason, you don't see what you definitely should (such as the 'memberOf' attributes) - check the rights of the account you're connected to LDAP with. Lost half of the day trying to figure out why nothing works after LDAP has migrated to another server.

Sunday, September 21, 2008

Refcards

I frequently see requests for refcards - here are THE two resources to explore if you need one:
Digilife, Refcardz (some cards require registration @ DZone).

Cygwin bash won't start? Uninstall Agnitum Outpost

I'm not much of a writer, so... uhm... see the subj.