Web Hosting Java, JSP, Tomcat 6, J2EE, Servlets, Struts, Jboss
JavaSercer Pages 3.4 JSP Application Design with MVC
November 27, 2006 on 9:44 am | In Java | JavaSercer Pages 3.4 JSP Application Design with MVC JSP technology can play a part in everything from the simplest web application, such as an online phone list or an employee vacation planner, to full-fledged enterprise applications, such as a human resource application or a sophisticated online shopping site. How large a part JSP plays differs in each case, of course. In this section, we introduce a design model suitable for both simple and complex applications called Model-View- Controller (MVC). MVC was first described by Xerox in a number of papers published in the late 1980s. The key point of using MVC is to separate components into three distinct units: the Model, the View, and the Controller. In a server application, we commonly classify the parts of the application as: business logic, presentation, and request processing. Business logic is the term used for the manipulation of an application’s data, i.e., customer, product, and order information. Presentation refers to how the application is displayed to the user, i.e., the position, font, and size. And finally, request processing is what ties the business logic and presentation parts together. In MVC terms, the Model corresponds to business logic and data, the View to the presentation logic, and the Controller to the request processing. Why use this design with JSP? The answer lies primarily in the first two elements. Remember that an application data structure and logic (the Model) is typically the most stable part of an application, while the presentation of that data (the View) changes fairly often. Just look at all the face-lifts that web sites have gone through to keep up with the latest fashion in web design. Yet, the data they present remains the same. Another common example of why presentation should be separated from the business logic is that you may want to present the data in different languages or present different subsets of the data to internal and external users. Access to the data through new types of devices, such as cell phones and Personal Digital Assistants (PDAs), is the latest trend. Each client type requires its own presentation format. It should come as no surprise, then, that separating business logic from presentation makes it easier to evolve an application as the requirements change; new presentation interfaces can be developed without touching the business logic. This MVC model is used for most of the examples in this java blog. In Part II, JSP pages are used as both the Controller and the View, and JavaBeans components are used as the Model. The examples in Chapter 5 through Chapter 7 use a single JSP page that handles everything, while Chapter 8 through Chapter 11 show how you can use separate pages for Control and View to make the application easier to maintain. Many types of real-world applications can be developed this way, but what’s more important is that this approach allows us to examine all the JSP features without getting distracted by other technologies. In Part III, we look at other possible role assignments when JSP is combined with servlets and Enterprise JavaBeans. page 33
Note: If you are looking for inexpensive but high quality provider to host and run your jsp application check Astra jsp hosting services
No Comments yet
Sorry, the comment form is closed at this time.
...I
just wanted to take the time to say "Thank you!" for our new webmail
system. It's great! Thanks for taking such good care of us.
Thanks
for helping me out. Just for the record, Webhostingjava.net has been a great
web host! So far your support and handling of questions has far
exceeded that of a "larger web hosting company".
I
would like to thank you for helping me with my domain...You have
shown me great patience and professionalism. I would not hesitate to
recommend you to my clients.