jquery is not defined – $ is not defined – firefox – datepicker

I’ve been working on jQuery for a while now and for some of the existing pages, datepicker stopped working. Nothing on the JSP changed in CVS. Then after pulling some hair, I realized someone removed jquery core js (jquery-1.3.2.min.js) file from the parent jsp that included this page.

Conclusion: The above error is almost always caused due to the missing jquery core script file. May you might have forgot to include it or the URL to the file is invalid.

Struts 2 checkbox – not checked – wierd behaviour with checking and unchecking of checkbox

This is the right way to use a checkbox in struts 2 or sturts 1:
The checkbox field should be backed by a boolean. In struts 2, the fieldValue attrubute of s:checkbox should be true. So when the box is checked and the form is submitted, the field value will be set to true. An added advantage in struts 2 is that you don’t have reset the field values to false. Struts 2 will automatically set it to false if that parameter doesn’t exist in the http post.

Avoid the common mistake of using non boolean fields for checkbox.