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
Can inner class extend any class?
What is method and methodology?
What's the purpose of using break in each case of switch statement?
What are the legal parameters?
What is the difference between variable declaration and variable initialization?
What is parseint?
What is a return in java?
What are untrusted applets?
What is an object’s lock and which object’s have locks?
String and stringbuffer both represent string objects. Can we compare string and stringbuffer in java?
How we can generate random numbers in java?
Explain about public and private access specifiers?
What is the primitive type short?
What is binary tree in java?
Why do we need array in java?