| Evolution of Web Application |
| |
| JSP Planning |
| |
| The two fundamental customs of using the JSP skill are : |
| . The client/server (page-centric) 2-tier approach and |
| . The N-tier approach (dispatcher). |
| |
| |
| The client/server (page-centric) 2-tier approach |
| Applications built using a client-server (2-tier) approach consist of one or more application programs running on client machines and connecting to a server-based application to work. |
| |
| This model allows JSPs or Servlets direct access to some resource such as database or legacy application to service a client's request. The JSP page is where the incoming request is intercepted, processed and the response sent back to the client. JSPs differ from Servlets in this scenario by providing clean code, separating code from the content by placing data access in EJBs. Even though this model makes application development easier, it does not scale up well for a large number of simultaneous clients as it entails a significant amount of request processing to be performed and
each request must establish or share a potentially scarce/expensive connection to the resource in question |
| |
| Page view: |
| This basic architecture involves direct request invocations to a server page with embedded Java code,
and markup tags which dynamically generate output for substitution within the HTML All the Java code may be embedded within the HTML,
so changes are confined to a very limited area, reducing complexity drastically. |
| |
| |
| The big trade: |
| As the scale of the system grows, some limitations
begin to surface, such as bloating of business logic code in the page instead
of factoring forward to a mediating Servlet or factoring back to a worker bean.
It is a fact that utilizing a Servlet and helper beans helps to
separate developer roles more cleanly and improves the potential for code reuse. |
| |
| Page-view with bean |
| This pattern is used when the above architecture becomes too cluttered with business-related code and data access code. The Java code representing the business logic and
simple data storage implementation in the previous model moves from the JSP to the JavaBean worker. |
| |
| |
|
| |
| |