Language: equality

Posted ascertain

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Language: equality相关的知识,希望对你有一定的参考价值。

 

Java

 

equal symbol expected 运行jsp时出现这个错误提示怎么解决?

<%@ page contentType="text/html; charset=GB2312" language="java" import="java.sql.*" errorPage=""%>
<%@ page import="cn.ac.ict.UserConn" %>
<html>
<head>
<title>checklogin page</title>
</head>
<body>
<jsp:useBean id="userlog" class="cn.ac.ict.UserConn" scope="session"/>
<jsp:include page="conn.jsp"></jsp:include>
<jsp:setProperty name="userlog" property="id"/>
<jsp:setProperty name="userlog" property="username"/>
<jsp:setProperty name="userlog" property="usertype"/>
<!--<jsp:setProperty name="userlog" property="password/>-->
<%
String lname;
int lpwd=0;
int tpwd=0;
String lid;
String usertype;
String sql;

lname=request.getParameter("lname");
usertype=request.getParameter("usertype");
lid=request.getParameter("lid");

if(usertype.equals("student"))

sql="select * from student where sname='"+lname+"'";

else if(usertype.equals("teacher"))

sql="select * from teacher where tname='"+lname+"'";

else

sql="select * from admin where adname='"+lname+"'";


ResultSet rs=userlog.query(sql);
int rowcount=0;

while(rs.next())

rowcount++;
if(usertype.equals("student"))

lid=rs.getString("snum");
lname=rs.getString("sname");
tpwd=rs.getInt("spasswd");


else if(usertype.equals("teacher"))

lid=rs.getString("tnum");
lname=rs.getString("tname");
tpwd=rs.getInt("tpasswd");


else

lid=rs.getString("anum");
lname=rs.getString("adname");
tpwd=rs.getInt("apasswd");




if((rowcount==1)&&(tpwd==lpwd))

if(usertype.equals("student"))

session.setAttribute("id",lid);
session.setAttribute("username",lname);
session.setAttribute("usertype","student");
response.sendRedirect("stutoppage.jsp");

else if(usertype.equals("teacher"))

session.setAttribute("id",lid);
session.setAttribute("username",lname);
session.setAttribute("usertype","teacher");
response.sendRedirect("teatoppage.jsp");

else if(usertype.equals("admin"))

session.setAttribute("id",lid);
session.setAttribute("username",lname);
session.setAttribute("usertype","admin");
response.sendRedirect("adtoppage.jsp");


else

out.println("登录失败,请重新<a href=\"top.jsp\" target=\"_top\">登录</a>");

%>
</body>
</html>
提示出错org.apache.jasper.JasperException: /checklogin.jsp(39,33) equal symbol expected
请问哪位高手能指点指点

参考技术A 请检查一下checklogin.jsp(39,33) 第39行的位置是否有单引号和双引号使用混乱的问题,如有,修改一下它们的次序关系,再试试 参考技术B 看不明白

以上是关于Language: equality的主要内容,如果未能解决你的问题,请参考以下文章

equal symbol expected 运行jsp时出现这个错误提示怎么解决?

怎么比较两个枚举类型是不是相等

校验字符串编码工具类

Assembly language:1-1 Machine Language

Ubuntu 14.10没有语言支持(language support

Django 1.3 LANGUAGE_CODE 不正确