why we use struts in our web application , means what was
drawbacks of servlet ...pls answer

Answer Posted / maneesha pandey

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(srtuts), 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.

Is This Answer Correct ?    14 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Who makes the struts?

707


What is interceptor? And life cycle methods of interceptor?

749


Explain the life cycle of a request in struct2 application?

681


What is the purpose of struts.properties in struct2?

695


What are the main classes which are used in struts application?

711


What is dispatch action class?

818


Are struts still used?

678


What is the purpose of @element annotation annotation?

777


What is the difference between requestaware and servletrequestaware interface?

782


How exceptions are handled in struts application?

757


What is role of actionservlet?

754


What is the purpose of form-be tag in struct-config.xml?

736


How to combine the struts with velocity template?

676


What is the purpose of action tag in struts.xml?

728


Can you explain struts validator framework?

755