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 are default methods ?
Why object class is super class for every class in java?
How will you load a specific locale?
What is a stringbuffer?
What is the difference between java applets and applications?
Can I overload to string method
What is * argv?
Explain how to convert any java object into byte array.
Why can't you declare a class as protected?
Difference between keyword and identifier.
What is natural ordering in java?
What does += mean in java?
Why we used break and continue statement in java?
what happens when a thread cannot acquire a lock on an object? : Java thread
What is finalize() function in java?