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

Answer Posted / aditya sinha

JSP is a part of presentation layer(View in MVC pattern)
which should be decoupled from controller or model, because
of its benifits of flexibility and modularity and focussed
responsibility.

By having the controller separate, we allow to choose the
presentations dynamically. But having them integrated
implies, change in presentation logic may also fiddle with
the controller segment embedded. Any new presentation would
attract unnecessary controller code repetition into it.

More over, if its(the controller segment) only an include
in JSP, then the overhead of JSP parsing to servlet is not
worth doing it.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does java have a compiler?

801


Who is the owner of java?

771


What do you understand by the bean persistent property?

784


What is the use of default method in interface in java? Explain

776


What is a superclass?

1128


How we create object in copy constructor?

886


What is tree node in java?

738


Can a class be defined inside an interface?

770


What are the 3 types of control structures?

736


Discuss different types of errors that generally occur while programming.

807


How many types of string data types are there?

774


Hi i am creating desktop application in that i want calling to mobile number. i have java telephone api (JTAPI) but i dont understand how it configure & use plese help me

1604


Explain which of the following methods releases the lock when yield(), join(),sleep(),wait(),notify(), notifyall() methods are executed?

864


If an object reference is set to null, will the garbage collector immediately free the memory held by that object?

901


which class is the wait() method defined in? : Java thread

732