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

What is a byte string?

625


What is appletviewer?

573


Is arraylist zero based?

559


What are different type of exceptions in java?

553


What is an infinite loop in java? Explain with an example.

588






Difference between keyword and identifier.

595


Where are global variables stored?

509


does java support pointers?

566


What is charat java?

543


Can one thread block the other thread?

608


what is thread in Java ?

629


Explain the difference between throw and throws in java?

552


What are generic methods?

537


What's the default access specifier for variables and methods of a class?

517


What is the equal sign?

565