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

What is tcp ip in java?

591


I want to print “hello” even before main is executed. How will you acheive that?

662


how to write a program for sending mails between client and server

1556


What is string in java? String is a data type?

580


does java support pointers?

566






How many types of constructors are used in java?

542


Can we able to pass objects as an arguments in java?

535


When parseint method can be used?

543


What is the Difference between Final Class && Abstract Class?

618


What do you mean by default constructor in java?

580


What is the difference between error and an exception?

570


Is the empty set a singleton?

543


Which class is the superclass for every class in java programming?

575


Difference between == and .equals() ?

576


Can an interface have a class?

568