我这个JPS程序运行的时候弹出一个错误
我写了一登录验证的程序,第一个是保存为login.html<html>
<head>
<title>A simple login Page</title>
</head>
<body>
<p>Please Login
<form action=login.jsp method=post>
<p>user name:<input type=text name=usenameField>
<p>password:<input type=text name=passwordField>
<p><input type=submit value=submit>
</form>
</body>
</html>
第二个保存为login.jsp<head>
<title>A simple login Page</title>
</head>
<body>
<p>Please Login
<form action=login.jsp method=post>
<p>user name:<input type=text name=usenameField>
<p>password:<input type=text name=passwordField>
<p><input type=submit value=submit>
</form>
</body>
</html>
<
html>
<head>
<title>A simple JSP That verifies Password Policy</title>
</head>
<body>
<%! final static int MIN_PSWD_LEN=8;
boolen verifyPasswordLength(String password){
if(password.length()<MIN_PSWD_LEN)return false;
return true;}
boolen verifyPasswordHasDigit(String password){
for(int i=0;i<password.length();i++)
if(Character.isDigit(password.CharAt(i))) return true;
return false;}
boolen verifyPasswordPolicy(String password){
if(verifyPasswordLength(password)&&verifyPasswordHasDigit(password))
return true;
return false;
}
%>
<% String password=request.getParameter("passwordField");
if(verifyPasswordPolicy(password)){%>
<p> thankyou
<p>Your password meets the security policy
<%}else{%>
<p>Sorry
<p>Your password does not meet the security policy
<p><A haef="login.html">Please try again</a>
<%}%>
</body>
</html>
但是我登录login.html输入用户名和密码之后弹出了<head>
<title>A simple JSP That verifies Password Policy</title>
</head>
<body>
<%! final static int MIN_PSWD_LEN=8;
boolen verifyPasswordLength(String password){
if(password.length()<MIN_PSWD_LEN)return false;
return true;}
boolen verifyPasswordHasDigit(String password){
for(int i=0;i<password.length();i++)
if(Character.isDigit(password.CharAt(i))) return true;
return false;}
boolen verifyPasswordPolicy(String password){
if(verifyPasswordLength(password)&&verifyPasswordHasDigit(password))
return true;
return false;
}
%>
<% String password=request.getParameter("passwordField");
if(verifyPasswordPolicy(password)){%>
<p> thankyou
<p>Your password meets the security policy
<%}else{%>
<p>Sorry
<p>Your password does not meet the security policy
<p><A haef="login.html">Please try again</a>
<%}%>
</body>
</html>
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 6 in the jsp file: /login.jsp Generated servlet error: [javac] Compiling 1 source file D:\Tomcat 5.0\work\Catalina\localhost\myapp\org\apache\jsp\login_jsp.java:11: ????? ??? ? boolen ??? ? org.apache.jsp.login_jsp boolen verifyPasswordLength(String password){ ^ An error occurred at line: 6 in the jsp file: /login.jsp Generated servlet error: D:\Tomcat 5.0\work\Catalina\localhost\myapp\org\apache\jsp\login_jsp.java:14: ????? ??? ? boolen ??? ? org.apache.jsp.login_jsp boolen verifyPasswordHasDigit(String password){ ^ An error occurred at line: 6 in the jsp file: /login.jsp Generated servlet error: D:\Tomcat 5.0\work\Catalina\localhost\myapp\org\apache\jsp\login_jsp.java:18: ????? ??? ? boolen ??? ? org.apache.jsp.login_jsp boolen verifyPasswordPolicy(String password){ ^ An error occurred at line: 6 in the jsp file: /login.jsp Generated servlet error: D:\Tomcat 5.0\work\Catalina\localhost\myapp\org\apache\jsp\login_jsp.java:16: ????? ??? ?? CharAt(int) ??? ? java.lang.String if(Character.isDigit(password.CharAt(i))) return true; ^ 4 ?? org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:127) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351) org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415) org.apache.jasper.compiler.Compiler.compile(Compiler.java:458) org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
我不知道是怎么回事啊.哪为大哥教教我