A Developers Perspective on Spring vs JavaEE

In the Java community, Spring vs. JavaEE is a never-ending debate. In such debates, people form two groups consisting of evangelists, architects, and hardcore fans of one platform and debate endlessly. Those who participate in the debates may be architects who are responsible for platform selection. But what would developers think about this Spring vs. JavaEE debate?

I am a Java developer who uses both Spring and JavaEE, and I am not part of the Spring or JavaEE fan club. Here, I would like to share my own thoughts on this epic Spring vs. JavaEE debate.

Keep The Code Clean: WatchDog & SpotTheBug Approach

Before discussing the WatchDog & SpotTheBug Approach, let me give a brief context on the need for this.

Three months back, I was asked to write core infrastructure code for our new application, which uses all the latest and greatest technologies. I have written the infrastructure code and implemented two use cases to demonstrate which logic should go into which layer, and the code looks good (at least to me :-)). Then I moved on to my main project, and I was hearing that the project that I designed (from now onwards, I will refer to this as ProjectA) is going well.

When to use RequestDispatcher.forward() and response.sendRedirect()?

Many people know how RequestDispatcher.forward() and response.sendRedirect() work.

RequestDispatcher.forward() is generally called server-side redirection and is used to forward to a resource within the same application. That resource could be a JSP or another servlet.

response.sendRedirect() is generally called client-side redirection, as it issues a new request from the browser. This method is used to redirect to another resource within the same application, to a resource in some other application running in the same web container, or to any other resource running in some other web container.