Hello Maheshwaran ,
Well, they are two really very different things. Programming web applications using servlets only is a very hard thing, since you will have to write your HTML code inside the servlet, which will produce complex, unreadable and unmaintainable code.
The same thing is with
JSP. If you program a web application using JSP alone, you'll have to put your
java code in JSP pages, which will also be very hard to read and maintain.
This was the reason of the rise of the model 2 architecture, where the servlet controls the flow of the request, calls a model class to do the business logic, decides which view (jsp or other) to send to the user, and then sends the response to the user. This is known as the MVC (Model-View-Controller) design
pattern.
Another pattern was also created and widely used, and that is the front controller pattern. This pattern simply says "Why do we have a separate controller for each request? Why don't we have a
SINGLE controller to decide what should be done with the request?". So here we have a single servlet that takes
ALL requests, and decides which class/method (model) should handle it, and which jsp/page/template (view) should be sent to the user.
Of course the classes that the servlet calls to handle the request should not always be the
MODEL. A typical use of struts actions is just to validate the data, and configure it, then pass the data to a service layer class to do the business logic, and this makes those action classes be considered as controllers/controller extensions, rather than the model.
From the previous paragraph, I'm sure that you have already guessed that struts is a web framework based on the front controller design pattern, and this is correct. Using struts will simplify development a lot, since it separates the business logic from the flow control and the view.
Another thing is that struts provides a set of useful tag libraries, a validation framework and the tiles framework (which allows you to create complex layouts by gluing simple JSPs together).
I hope that this would help you.