So sad ... Write login before you see a good blog post, no collection, and then can not find.
A few days ago I saw a problem and when I felt the most powerless.
The previous two days have been trying to answer: tried all the Google solve case, the result bug is still.
Today wants to answer: Obviously met, just can't find the article. Cry!
================================================
Learn MVC pattern (actually JSP job), of course, this is not just servlet+jsp+javabean a case, it is a kind of thought, realizes the function division of the web system.
For JSPs:
Model layer: Implement the business logic of the system, that is, the JavaBean part
View layer: Responsible for interacting with the user, that is, to display the data objects on the interface to the user, i.e. html,jsp
Control layer: A bridge between model and view that can dispatch a user's request and select the appropriate view for display, and it can also interpret the user's input and map them as executable operations of the model layer, which is, of course, the responsibility of the servlet.
It must be incomprehensible to say so:
Very image ah have wood has. In layman's words, all HTTP requests made by the Web Broswer through the View layer's JSP page should be given to the servlet, the control layer. The servlet obtains processing results by processing the JavaBean, the core model layer, and then returns to the JSP page of the view layer. The JSP page returns to the browser's last HTML page.
Is it still a little blurry ... In fact, see an example to know ...
=======================================================
Servlet+jsp+javabean MVC mode Implements login Registration function:
First look at the overall layout:
The structure of the whole system is probably:
All right. Did not seem to have achieved the desired effect. "I always thought I'd draw a picture ..."
Then the Web. XML is configured. Of course, I only deserve the simplest and most necessary:
Then, we have a general understanding of this most classic MVC pattern.
Well. And then there's no more.
Servlet+jsp+javabean development Model (MVC) Introduction