why business logic written using servlets not in jsp. Jsp
used for presentation purpose. serlvet used for coding
business logic and controller logic. Reason for using
servlets in business logic.

Answer Posted / nishant

Actually the main reason behind this when the servlet is
used for both presentation & business logic, the tight
coupling between presentation & business logic creates the
problem to the reusablity, because sometime change in
business logic tends to change in presentation logic. Apart
from that the tags & HTML like enviroment makes the webpage
more dynamic.

Now if we are using jsp page for business logic then
scriptlet will be more inside the JSP page which leads to
heavy maintaince cost. The business techies call it as
MODEL1 Architecture.

The seperate declaration of servlet for business unit will
avoid all above.Say MODEL2 Architecture.

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In the servlets, we are having a web page that is invoking servlets ,username and password? which is checks in database? Suppose the second page also if we want to verify

582


Is servlet synchronized?

595


Difference between java beans & servlets?

583


Name the different ways of session tracking.

567


How do you run a servlet?

537






What do you mean by httpservlet and how it is different from the genericservlet?

534


How to create war file?

607


What is session tracking?

693


What are the types of protocols supported by httpservlet ?

698


What is session?

634


Once the destroy() method is called by the container, will the servlet be immediately destroyed? What happens to the tasks(threads) that the servlet might be executing at that time?

767


What are the different ways we can maintain state between requests?

565


What are the differences between forward() method and sendredirect() methods?

541


Write a program to show the functionality of doget and dopost method?

649


Explain the difference between get and post method in servlet?

594