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
Explains the differences between context.getrequestdispatcher() and request.getrequestdispatcher()?
What are advantages of servlets over cgi?
What is the directory structure of a war file?
What is Request Dispatcher?
Write a hello world program using servlets.
What are all the ways for session tracking?
Why do we need servlet filter?
What is servlet? Explain
Explain the servlet context.
What is difference between the HTTP Servlet and Generic Servlet? Explain about their methods and parameters?
The code in a finally clause will never fail to execute, right?
What is the difference between the getrequestdispatcher(string path) method of javax.servlet.servletrequest interface and javax.servlet.servletcontext interface?
what is servlet chaining?
What is the difference between servlet and filter?
Which method of the httpservletrequest object is used?