if(a.equales(b))
但我要写不等的情况,请问要怎么写啊?
我改了,可还是报错,是不是别的地方有问题?
String sql = "select agentcode,name,idno,agentstate from laagent where agentcode='"+acode+"'";
rs=Exe.execSQL(sql);
if((rs.GetText(1,1) == null) || (!rs.GetText(1,1).equales(acode))){
out.println(""+rs.GetText(1,1)+"");
out.println(""+acode+"");
out.println("<center><table><tr><td>请核对您的代理人号</td></tr></table></center>");
}
else if((rs.GetText(1,4)!="02") || (rs.GetText(1,4) != "01" )){
out.println("<center><table><tr><td align='center' valign='middle'>您在核心业务系统中的状态已为\"离司\"</td></tr></table></center>");
}
else if((!rs.GetText(1,2).equales(name)) || (!rs.GetText(1,3).equales(idno))){
out.println("<center><table><tr><td align='center' valign='middle'>请核对您的姓名或身份证号号</td></tr></table></center>");
}
这是整个的jsp代码:
<%
request.setCharacterEncoding("GBK");
String name = request.getParameter("name");
String pass = request.getParameter("pass");
String truename = request.getParameter("truename");
String sex = request.getParameter("sex");
String idno = request.getParameter("idno");
String acode = request.getParameter("acode");
String mobile = request.getParameter("mobile");
String usertype = request.getParameter("usertype");
boolean flag = true;
ExeSQL Exe = new ExeSQL();
SSRS rs = new SSRS();
SSRS samers = new SSRS();
String sql = "select agentcode,name,idno,agentstate from laagent where agentcode='"+acode+"'";
rs=Exe.execSQL(sql);
if((rs.GetText(1,1) == null) || (!rs.GetText(1,1).equales(acode))){
out.println(""+rs.GetText(1,1)+"");
out.println(""+acode+"");
out.println("<center><table><tr><td>请核对您的代理人号</td></tr></table></center>");
}
else if((rs.GetText(1,4)!="02") || (rs.GetText(1,4) != "01" )){
out.println("<center><table><tr><td align='center' valign='middle'>您在核心业务系统中的状态已为\"离司\"</td></tr></table></center>");
}
else if((!rs.GetText(1,2).equales(name)) || (!rs.GetText(1,3).equales(idno))){
out.println("<center><table><tr><td align='center' valign='middle'>请核对您的姓名或身份证号号</td></tr></table></center>");
}
else {
String SQL = "insert into ls_user_tbl (type,name,password,realname,sex,idno,agentcode,tel,enabled_flag) values('"+usertype+"','"+name+"','"+pass+"','"+truename+"','"+sex+"','"+idno+"','"+acode+"','"+mobile+"','0')";
Exe.execUpdateSQL(SQL);
out.println("<center><table><tr><td align='center' valign='middle'>用户添加成功,两秒后跳转到登陆页面!!<br>如果没有跳转,请按<a href = '/suggestion/login.jsp'>这里</a></td></tr></table></center>");
}
%>
这是报错:
An error occurred at line: 24 in the jsp file: /suggestion/register/test/regSave.jsp
Generated servlet error:
D:\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\suggestion\register\test\regSave_jsp.java:94: cannot resolve symbol
symbol : method equales (java.lang.String)
location: class java.lang.String
if((rs.GetText(1,1) == null) || (!rs.GetText(1,1).equales(acode))){
^
An error occurred at line: 24 in the jsp file: /suggestion/register/test/regSave.jsp
Generated servlet error:
D:\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\suggestion\register\test\regSave_jsp.java:104: cannot resolve symbol
symbol : method equales (java.lang.String)
location: class java.lang.String
else if((!rs.GetText(1,2).equales(name)) || (!rs.GetText(1,3).equales(idno))){
^
An error occurred at line: 24 in the jsp file: /suggestion/register/test/regSave.jsp
Generated servlet error:
D:\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\suggestion\register\test\regSave_jsp.java:104: cannot resolve symbol
symbol : method equales (java.lang.String)
location: class java.lang.String
else if((!rs.GetText(1,2).equales(name)) || (!rs.GetText(1,3).equales(idno))){
^
3 errors
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:437)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:497)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)