DirectorySoftwareBlog Details for "Java Donkey"

Java Donkey

Java Donkey
java, j2ee, spring, hibernate, jsp, jstl, j2se, rup, servlets, design, open source, frameworks

Articles

JSP Custom Tag Pooling
2007-08-21 00:00:00
On my current project, as part of a performance enhancement, I was asked to implement ‘JSP Tag Pooling’ for our custom JSP tags. I had never heard of this before. I was given some instructions to implement the TryCatchFinally interface and also implement a release() method on each custom tag to set the ...
More About: Custom
Unable To Marshal Type - XMLRootElement Annotation
2007-08-06 00:00:00
Recently, I was trying to marshal an XJC generated JAXB object to XML in order to display the XML in a JSP page on the screen for debugging purposes. The code I had looked like this… marshaller.marshal(myObject, response.getOutputStream()); I got this error… com.sun.istack.SAXException2: unable to marshal type “com.myCompany.myPackage.myObject&# 8221; as an element because the JAXB object myObject is missing ...
More About: Type , Root , Element , Anno
Sleep Main Thread
2007-07-28 00:00:00
When working with Java Concurrency (multi-threading), don’t forget that you might need to sleep the main thread if you are ‘waiting’ for other threads to complete. By ‘waiting’ I mean that maybe your application is looping over a list of threads in a thread pool, checking each one to see if it has completed yet. ...
More About: Main , Sleep , Thread
Injecting Simple Values with Spring
2007-07-13 00:00:00
Spring IoC (Inversion of Control) makes it very easy to inject simple values into your java classes. By default, the <value> tag in the Spring configuration can convert String values to any primitive or primitive wrapper class meaning you can inject more than just Strings. Take this java class for example: public class Simple tInjectionSample { private ...
More About: Spring , Values
Casting Arrays and Collection.toArray(T[] a)
2007-07-10 00:00:00
I ran into a problem today when attempting to convert a List to an Array . I kept getting a java.lang.ClassCastException when trying to cast an Object[] to a Donkey[]. The suspect code was as follows: List myListOfDonkeys = myObject.getMyListOfDonkeys(); Donkey[] donkeys = (Donkey[])myListOfDonkeys.toArray(); This did not work and resulted in a java.lang.ClassCastException. After some experimenting, I changed ...
More About: Casting , Arrays , Rays , Coll
Beware of Defensive Null Checking
2007-07-10 00:00:00
Beware of ‘defensive null checking’. I used to make the mistake of constantly checking things for null. Take a look at this code and see if you can spot the problem: public void doSometing(Object myObject) { if(myObject != null) { myObject.doSomethingElse(); } } This type of coding is called ‘defensive null checking’. Usually defensive null checking surfaces when ...
More About: Beware , Null
JavaScript focus() needs Tabindex
2007-07-07 00:00:00
On my current project, I was asked to set focus to a link that was part of an unordered list. I thought this would be easy enough by just calling focus() on the id of the li. This did not work so I decided to put an id on my anchor tag ...
More About: Javascript , Focus , Index , Needs
Is Dependency Injection Worth It?
2007-07-05 00:00:00
So I’ve been reading up on the benefits of Dependency Injection using Spring IoC. Basically the biggest benefit is that you can easily replace a component with a new one by updating the Spring configuration file. This is useful when: 1. You need to do unit testing, and you are only concerned with ...
More About: Worth , Epen , Wort
JavaScript - Set Focus to First Form Field
2007-06-28 00:00:00
If you are building web applications, chances are you might need to set focus to the first field on the HTML form when the web page loads. This is a fairly common business requirement so that users can just start filling out the application instead of having to click or tab to ...
More About: Javascript , Focus , Form , Field
Life at Google vs Microsoft: What About the Rest of Us?
2007-06-28 00:00:00
I found the Life at Googl e , The Microsoft ie Perspective post to be somewhat interesting (whether it turns out to be legit or not) perspective on different developer jobs. One thing it got me thinking about was what about the rest of us? What about the hordes of developers (including me) who don’t work for Google, ...
More About: Rest
80083 blogs in the directory.
Statistics resets every week.


Contact | About
© Blog Toplist 2009 - Supported by Web Catalog - SEO by FeWorks
eXTReMe Tracker