JavaBean is a Java class used to implement the business logic layer.
What do you mean? I'll make it short: we know that JSP programming is to write Java code into an HTML file, and JavaBean programming is to write Java code in another Java class file, then we just need to call the Java file in the HTML file, of course, all the files are in a project. This is called JavaBean, which is the code for the business logic layer.
Here's an example of a simple idea of JavaBean programming: Implementing a Circle's area calculation and then displaying the results on the page.
First we write the Java code to be used in a Java class file, Java code can implement the definition of the class, variable definition, function definition, and so on functions
Here I simply define a circle radius and area function. As you can see, it's all Java code, without any HTML elements.
And then we just need to call it in the page, and there's a comment in the code.
Now our HTML page has no Java code, and the Java code we're going to execute is in another place. After the program runs, you will see that the area of the circle with radius 20 is displayed on our page.
To summarize: JavaBean programming is to separate the Java code from the HTML code, we see the client only HTML code, and we call the Java code is executed on the server side. Professional said JSP file implementation of user interface layer view, is the appearance of our page, that is, the Web front-end. And JavaBean implements the business logic layer model, which is called the Web backend. We often have a servlet programming, implementation of the control layer, this will give you a detailed explanation, I hope you can understand JavaBean programming a realization idea.
Basic idea of JavaBean programming-logic business layer