1 / 13

The Dispacher Approach And JSP Technical Support

The Dispacher Approach And JSP Technical Support. The Dispacher Approach. The dispatcher or "N-tiered" approach, where a Servlet (or JSP) acts as a mediator or controller, delegating requests to JSP pages and JavaBeans

jenn
Download Presentation

The Dispacher Approach And JSP Technical Support

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Dispacher ApproachAndJSP Technical Support

  2. The Dispacher Approach The dispatcher or "N-tiered" approach, where a Servlet (or JSP) acts as a mediator or controller, delegating requests to JSP pages and JavaBeans There are mediator-view, mediator-composite view, and service to workersarchitectures

  3. Mediator-View Factoring common services, such as authentication out to a mediating Servlet allows us to remove potential duplication from our JSP pages For example, we could have a servlet that checked that the user was authenticated, and forwarded the request once this was established

  4. Mediator-View (cont…)

  5. Mediator- Composite View Sometimes we are building systems with dynamic template text as well as dynamic content In other words, there is content being generated dynamically, and the template text that surrounds this data is also being constantly changed Imagine that there are headers and footers in a page that are modified quite often, notifying individuals of status changes or information of special interest It may not be desirable to recompile our JSP source each time this template text changes, since this involves a run time delay and resource load

  6. Mediator- Composite View (cont…) If we simply type our header and footer text directly into our JSP source, then we will need to modify that source each time we want to change the template text, and our modified source will need to be re-translated in order to service another request, causing this run time latency, and this scenario will repeat itself each and every time the text undergoes even slight modification

  7. Mediator- Composite View (cont…)

  8. Service to Workers The initial delegation point of the Service to Workers architecture, shown visually below, is a worker bean that processes our business and data access code, once again via a client-side business abstraction As with each of the dispatcher architectures, the Servlet handles the request from the client, providing the opportunity for the processing of common services After the worker bean has completed its responsibility of populating the intermediate model for the JSP, the Servlet dispatches to the JSP to generate the presentation:

  9. Service to Workers (Cont…)

  10. JSP Technical Support On clicking Submit Request, the aaplication checks whether the user is known to the system (based on their e-mail address), and if not forwards the request to the customer registration page

  11. JSP Technical Support Once these details have been entered, the confirmation page is displayed

  12. JSP Technical Support If the user’s e-mail address is already registered, the user will be taken straight to this page rather than to the registration form

  13. Application Design TechSupportServlet has been replaced by techSupport.jsp, register.html by regform.jsp, RegisterCustemerServlet by register.jsp, ResponseServlet by response.jsp, and BannerServlet by banner.jsp

More Related