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
Which variables are stored in stack?
Why there is no call by reference in java?
What do you mean by of string::valueof expression in java 8?
What is a prefix function.write down a code to compute prefix function.
What do you understand by overloading and overriding in java?
How to create com object in Java?
What do you mean by byte code?
How do you convert an int to a string in java?
Name component subclasses that support painting in java programming?
What restrictions are placed on method overriding?
What is a values collection view ?
What is pojo class in java?
What about main thread in java?
What do you mean by local class?
Why are arrays useful in java?