请高手帮我看一下代码??
<html>
<head>
<title>提交表单</title>
</head>
<body>
<%
//此段为函数区,先定义一个类
class check{
//检查输入是否为空
public Boolean isEmpty(String str){
str=str.trim();
if(str.length()==0)
return true;
else return false;
}
}
String name=request.getParameter("name");
check mycheck=new check();
%>
姓名:<%=name%>
<%
String str="";
String error="";
if(mycheck.isEmpty(name))
{
str="error ! name is empty!";
}
if(name.length()>50)
{
str="error! name is too long !";}
if(str.indexOf("error")!=-1)
{out.print(str);
error="a";
}
%>
</body>
</html>
我用的jswdk总是出错!不知道为什么?我是一个初学者,现在很苦恼,请帮忙!
出现的故障如下。
IMPORTANT: Do not modify the generated servlets
Unhandled error! You might want to consider having an error page to report such
errors more gracefully
com.sun.jsp.JspException: Compilation failed:Note: sun.tools.javac.Main has been
deprecated.
work\%3A80%2F\check2_jsp_1.java:76: Incompatible type for return. Can't convert
boolean to java.lang.Boolean.
return true;
^
work\%3A80%2F\check2_jsp_1.java:77: Incompatible type for return. Can't convert
boolean to java.lang.Boolean.
else return false;
^
work\%3A80%2F\check2_jsp_1.java:92: Incompatible type for if. Can't convert java
.lang.Boolean to boolean.
if(mycheck.isEmpty(name))
^
3 errors, 1 warning