From the perspective of a three-tier structure, a project consists of at least three layers: data layer, business processing layer, and page display layer. Of course, it can be more complicated. Servlet is powerful for writing business processing layers, but it is inconvenient for writing interfaces. JSP is designed to facilitate the writing of interfaces.
JSP should only store interface-relatedCodeThat is to say, only the HTML page is output. All data computing, data analysis, and database connection processes are business processes and should be placed in Java Beans. Java Beans are called through JSP to achieve integration of two layers.You can write data to the business processing layer. After learning JSP, you must also learn to use Java Bean and integrate it-JSP + bean!
After JSP + bean adopts the component technology, all components are compiled first, resident in the memory, and then run quickly. Http://blog.csdn.net/wang_zhou_jian/article/details/5420338 MVC
Multi-model structure of http://archive.cnblogs.com/a/1801313/
ClassicMVCUsage
Request arrivalServlet,ServletWrite itBean(If needed)
ServletJumpJSP
JSPTo obtainBeanData in