在线等!帮忙看看我的代码出错在那里?The left-hand side of an assignment must be a variable
<%@pagecontentType="text/html;charset=gb2312"%><%@includefile="incoming/common.jsp"%>...
<%@page contentType="text/html;charset=gb2312"%>
<%@ include file="incoming/common.jsp"%>
<%@ include file="incoming/connectdb.jsp"%>
<%
String name =(String)session.getAttribute("name");
session.setAttribute("name",name);
String errmsg = request.getParameter("errmsg");
request.getSession(true);
String chk = "false";
session.putValue("Enter",chk);
%>
<body>
<form name="form1" method="post" action="chkchmsp.jsp" id = "page">
<table width="60%" height="112" border="1" align="center" cellpadding="1" cellspacing="1" class="body">
<tr>
<td width="26%" height="25" align="center" class="body">教师姓名 </td>
<td width="74%">
<%=name%>
</td>
</tr>
<tr>
<td width="26%" height="22" align="center" class="body">旧密码</td>
<td width="74%">
<input type="password" name="oldpassword" size="15"></td>
</tr>
<tr>
<td width="26%" height="22" align="center" class="body">新密码</td>
<td width="74%">
<input type="password" name="newpassword" size="15"></td>
</tr>
<tr>
<td width="26%" height="22" align="center" class="body">确认密码</td>
<td width="74%">
<input type="password" name="newpassword2" size="15"></td>
</tr>
<tr align="center">
<td height="36" colspan="2" align="center"><input type="submit" name="Submit" value="提交" onClick="javascript:return(checkform());">
<input type="reset" name="reset" value="清空"></td></tr>
<tr><td width="100%"><div align="left"><font size="2" color="#CC3333">
</font> </div></td></tr>
</table>
</form>
第二页代码是
<%@page contentType="text/html;charset=gb2312"%>
<%@ include file="incoming/common.jsp"%>
<%@ include file="incoming/connectdb.jsp"%>
<%
String username =(String)session.getAttribute("name");
String newpassword = request.getParameter("newpassword");
String oldpassword = request.getParameter("oldpassword");
sql = "SELECT * FROM userpassword WHERE username='"+username+"' AND password='"+oldpassword+"'";
rs = smt.executeQuery(sql);
if (!rs.next())
{
String errmsg="error1";
response.sendRedirect("changeusermsg.jsp?errmsg="+errmsg);
return;
}
request.getSession(true);
String chk="true";
session.putValue("Enter",chk);
session.setAttribute("username",username);
session.setAttribute("newpassword",newpassword);
response.sendRedirect("querymsg.jsp");
%>
抛出异常为:
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 4 in the jsp file: /jsrz/chkchmsp.jsp
The left-hand side of an assignment must be a variable
3: <%@ include file="incoming/connectdb.jsp"%>
4: <%
5: ResultSet _rs;
An error occurred at line: 4 in the jsp file: /jsrz/chkchmsp.jsp
Syntax error on token "Invalid Character", invalid AssignmentOperator
3: <%@ include file="incoming/connectdb.jsp"%>
4: <%
5: ResultSet _rs=null;
赋值了,还是不行! 展开
<%@ include file="incoming/common.jsp"%>
<%@ include file="incoming/connectdb.jsp"%>
<%
String name =(String)session.getAttribute("name");
session.setAttribute("name",name);
String errmsg = request.getParameter("errmsg");
request.getSession(true);
String chk = "false";
session.putValue("Enter",chk);
%>
<body>
<form name="form1" method="post" action="chkchmsp.jsp" id = "page">
<table width="60%" height="112" border="1" align="center" cellpadding="1" cellspacing="1" class="body">
<tr>
<td width="26%" height="25" align="center" class="body">教师姓名 </td>
<td width="74%">
<%=name%>
</td>
</tr>
<tr>
<td width="26%" height="22" align="center" class="body">旧密码</td>
<td width="74%">
<input type="password" name="oldpassword" size="15"></td>
</tr>
<tr>
<td width="26%" height="22" align="center" class="body">新密码</td>
<td width="74%">
<input type="password" name="newpassword" size="15"></td>
</tr>
<tr>
<td width="26%" height="22" align="center" class="body">确认密码</td>
<td width="74%">
<input type="password" name="newpassword2" size="15"></td>
</tr>
<tr align="center">
<td height="36" colspan="2" align="center"><input type="submit" name="Submit" value="提交" onClick="javascript:return(checkform());">
<input type="reset" name="reset" value="清空"></td></tr>
<tr><td width="100%"><div align="left"><font size="2" color="#CC3333">
</font> </div></td></tr>
</table>
</form>
第二页代码是
<%@page contentType="text/html;charset=gb2312"%>
<%@ include file="incoming/common.jsp"%>
<%@ include file="incoming/connectdb.jsp"%>
<%
String username =(String)session.getAttribute("name");
String newpassword = request.getParameter("newpassword");
String oldpassword = request.getParameter("oldpassword");
sql = "SELECT * FROM userpassword WHERE username='"+username+"' AND password='"+oldpassword+"'";
rs = smt.executeQuery(sql);
if (!rs.next())
{
String errmsg="error1";
response.sendRedirect("changeusermsg.jsp?errmsg="+errmsg);
return;
}
request.getSession(true);
String chk="true";
session.putValue("Enter",chk);
session.setAttribute("username",username);
session.setAttribute("newpassword",newpassword);
response.sendRedirect("querymsg.jsp");
%>
抛出异常为:
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 4 in the jsp file: /jsrz/chkchmsp.jsp
The left-hand side of an assignment must be a variable
3: <%@ include file="incoming/connectdb.jsp"%>
4: <%
5: ResultSet _rs;
An error occurred at line: 4 in the jsp file: /jsrz/chkchmsp.jsp
Syntax error on token "Invalid Character", invalid AssignmentOperator
3: <%@ include file="incoming/connectdb.jsp"%>
4: <%
5: ResultSet _rs=null;
赋值了,还是不行! 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询