Java EE 6 SCWCD Mock Exam

The mock exam has been moved to a separate application working on the OpenShift and is available at exam.piotrnowicki.com. This post will be still available because of the comments – at this point the exam simulator doesn’t have the commenting functionality so you can leave your opinion here. In time it’ll be modified and will allow to post comments directly next to the questions. If you’d like to get more information about the exam migration take a look at this post: New OCE WCD Exam Simulator....

March 27, 2011 · 1 min

Using Servlets 3.0 ServletContainerInitializer

Servlets 3.0 in Java EE 6, brings new interface called ServletContainerInitializer. The name is very self-explanatory, but the question is – how it’s different from the ServletContextListener? Well, technically, the ServletContainerInitializer is not a listener – it is an initializer and it’s executed before any servlet context will even be ready. You can use this initializer to do some programmatic servlet/filters/listeners addition (which is also possible in Servlets 3.0!). The ServletContainerInitializer....

March 20, 2011 · 2 min

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....

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....

January 13, 2011 · 1 min