Defining JSP version for Tag Files with implicit TLD

If you want to use new features of JSP >= 2.1 and EL, like deferred binding (the #{…} construction in EL), you’ll find that you cannot achieve it within a Tag File with implicit TLD generation. It is simply because the implicit TLD defines that the Tag File is using JSPs in version 2.0. How to solve it? There are two possible solutions: deliver an explicit TLD for your Tag Files, modify the implicit TLD form. Deliver an explicit TLD This solution is an obvious one – when you define the TLD you can set the version attribute for <taglib> element which defines the JSP version. But defining an explicit TLD when you deploy your Tag Files directly into the web container seems to be a bit of a redundancy. ...

February 20, 2011 · 2 min

JavaBeans -- getters with Boolean type

When you want to create a boolean property in a Java Bean (let’s name it visible), you most likely would want to use a boolean type variable and create accessors for it. Well, if you use a boolean primitive it is allowed to create a getter in one of two manners: public boolean getVisible() or public boolean isVisible() Notice that the second option is only allowed when your property is a boolean primitive. Therefore, when your property is a Boolean object, the getter should be in only one form: ...

January 13, 2011 · 1 min