Relationship between JSP, Java Bean, and Servlet

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.