Why can't we make jsp as a controller and action
servlet in struts?

Answer Posted / sivadasan

Most of the applications are created in MVC design pattern
to seperate the functions of differnet components and
handle the complexity of applications.

JSP and Servlets are the server side components which can
respond to the client request.

Servlets are the basic components for request handling in
Web Server. They contains pure Java code.

Everything that needs to be done to generate the proper
user response (which is genarally HTML code) needs to be
done through coding. As a single servlet cannot respond
each and every request by itself as client request varies
in type (e.g. enquiry update request add etc) the request
and response object is passed onto different servlets with
little task completed by each servlet.

This controlling part is easier to write in java. So
Servlet is used as controller.

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When should I use singleton pattern?

816


What is int lol?

881


What is the instance of an object?

864


What do you understand by casting in java language?

813


Is call by reference possible in java?

742


Why you should not use singleton?

765


Can we declare an array without size in java?

734


How is hashset defined in java?

750


What is a lightweight component?

816


What are the differences between throw and throws?

853


What is 32 bit float?

779


What is bubble sorting in java?

831


how to create multithreaded program? Explain different ways of using thread? : Java thread

754


What is the purpose of using java.lang.class class?

763


What all access modifiers are allowed for top class ?

963