Search This Blog

Sunday, 15 November 2015

Servlet 3.x - time to have a look

Its not brand new - in fact it first appeared in December 2009. Since starting to use servlets (actually servlet 2.5) I never really bothered to look at the specs. What started with application development using MVC and having multiple servlets changed to Spring framework with a single controller and lot of JSPs and then less JSPs and more AJAX. Along the way, my web.xml changed to refer to 3.0 and then 3.1.

Saturday, 7 November 2015

Be careful with Sets and equals behavior

I was recently assigned to fix a bug in the code. For the scope of this post I re-framed the problem as below:
Context: There is a set of objects of each type (lets say fruits). Over a series of operations different type of fruits are added to the set. In certain stages certain fruits may be replaced by others in the family. For example during stage 4, we may need to replace a green apple by a red apple. On the final page we display all the fruits selected.
Problem: While the various fruits show up, the changes are not seen. So if we had updated the apple to be a red one, the final result still displays a green apple.

Wednesday, 4 November 2015

Primitives and Lambdas

II have been playing with the lambda expressions and they have all involved working with objects. There are also some classes in the SDK that have been created for working with primitives.