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
What is the difference between private & public & friendly classes?
What is a nullable field?
How the metacharacters are different from the ordinary characters?
What are variable arguments or varargs?
How to sort elements in a parallel array in java?
Is linkedlist thread safe in java?
What is the purpose of the finalize() method?
Write a program to check for a prime number in java?
Do loops java?
Can we initialize the final blank variable?
What initialize variables?
Why collection doesn’t extend cloneable and serializable interfaces?
what is ststic with example
Why are getters and setters used?
Explain 5 features introduced in jdk 1.7?