This article introduces an MVC instance involving the following files: l login. JSP -- View part of the input file l success. JSP -- View part of the output file l failure. JSP -- View part of the output file l loginbean. java -- model part l loginservlet. java -- controller part l web. the XML-web application configuration file is described as follows: 1. login. JSP: the input file of this function. The user first accesses this file. It is mainly used to enter the user name and password. The Code is as follows: <% @ page contenttype = "text/html; charset = gb2312" %> <script language = "JavaScript"> function isvalidate (form) {// obtain username = form. username. value; userpass = form. userpass. value; // determine the username length if (! Minlength (username, 6) {alert ("the username length is less than 6 characters! "); Form. username. Focus (); Return false;} If (! Maxlength (username, 8) {alert ("the username length is greater than 8 characters! "); Form. username. Focus (); Return false ;}// determine the password length if (! Minlength (userpass, 6) {alert ("the password length is less than 6 characters! "); Form. userpass. Focus (); Return false;} If (! Maxlength (userpass, 8) {alert ("the password length is greater than 8 characters! "); Form. userpass. focus (); Return false;} return true;} // verify whether the minimum length function minlength (STR, length) {If (Str. length> = length) return true; else return false;} // determines whether the maximum length of the function maxlength (STR, length) {If (Str. length <= length) return true; else return false ;} </SCRIPT> <HTML>