Well, part of the blog share my summary of Jsp-servlet-javabean ideas and the basic flow of the three-tier programming model, ZH-CNMVC This example to implement the programming pattern of the demo-login authentication process, where I am still using static authentication username and password. Guest, here is just a realization process to tell everyone. Not much to say, see the code:
First, create a JSP login page
Second, we build a servlet class to get the information submitted by the client.
And then. We need to configure the servlet option on the Web. XML, as if Eclipse is now actively generating the servlet's configuration code on its own. Just take a look at it.
Well, finally, we'll build a javabean. Detailed implementation of user authentication
Now. A complete MVC programming pattern is over, of course I'm doing very easy here. We can make it up to you.
Summary: The first JSP user interface inputs username and password to the end of the server Login_servlet. The server ends Login_servlet to reach the client from the information data. The server then uses this information as a parameter JavaBean to perform the corresponding functions, examples username, and password authentication, and the resulting server side will be able to return to the corresponding result client.
MVC Pattern Programming Demo sample-login authentication (static)