Friday 14 September 2012

Can we compile an empty java file?

Can we compile an empty java file?

Qn: Can we complie an empty java file named abc.java without any content in it?

Ans: Yes we can compile it. :)

Qn: Will you get any class file if you compile an empty java file?

Ans : No

Monday 10 September 2012

What is the main difference between Spring MVC and Struts MVC?

So it is the time to post a basic question "What is the main difference between Spring MVC and Struts MVC?"

If you ask this question, defenitly you will recieve more than 5 answers. Since we need something that can be very well conviencing, I am putting it in a very simple manner.

Struts is an old MVC 2 framework and it is using "Servlet Container" for loading it's own Action Servelt. So all the objects are living in this Servlet Container.

But in the case of Spring, it is also using "Servlet Container" for loading it's own Dispatcher Servelt. But here is a huge difference. Dispatcher Servelt loads another light weight container called Spring Container(ApplicationContext) and all the objects(Beans) are living inside this container. So spring itself is giving us a container and with which we can do more.