org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 10 in the jsp file: /login_ok.jsp
Generated servlet error:
temp cannot be resolved
An error occurred at line: 27 in the jsp file: /login_ok.jsp
Generated servlet error:
Syntax error on token "Invalid Character", ; expected
An error occurred at line: 34 in the jsp file: /login_ok.jsp
Generated servlet error:
Syntax error on token "Invalid Character", ; expected
An error occurred at line: 34 in the jsp file: /login_ok.jsp
Generated servlet error:
Syntax error on token "Invalid Character", ; expected
都是些什么错误啊,找半天也没找出来啊 ,发现好像没有漏掉;号阿!!!
我的代码一部分:
<%@ page contentType="text/html;charset=GBK"%>
<HTML>
<HEAD>
<TITLE>重新登录</TITLE>
<META content="text/html;charset=gb2312" http-equiv="Content-Type">
<LINK href="css/site.css" rel=stylesheet>
<%@ page language="java" import="java.sql.*" %>
<jsp:useBean id="userBean" scope="page" class="UseInfo.Conn"/>
<%!
public String getStr(String str)
{
try
{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("ISO8859-1");
return temp;
}
catch(Exception e)
{
}
return "null";
}
%>
<%
String username,password;
boolean loginAttempt=false;
boolean loginOK=false;
String errorMessage="请您登录";
%>
<%
if(request.getParameterValues("login")!=null&&request.getParamterValues
("username")!=null&&request.getParamterValues("password")!=null)
{
loginAttempt=true;
}
if(loginAttempt)
{
username=request.getParamterValues("username");
password=request.getParamterValues("password");
username=getStr(username);
password=getStr(password);
String sql="select * from userinfo where username=username
and password=password";
out.println(sql);
ResultSet RS=userBean.executeQuery(sql);
int rowscount=0;
try
{
while(RS.next())
{
rowscount++;
}
}
catch(Exception e)
{
}
//out.println(rowscount);
if(rowscount!=0)
{
errorMessage="登录成功!!!";
session.setAttribute("username",username);
loginOK=true;
if(loginOK)
{
response.sendRedirect("index.jsp");
}
}
else
{
errorMessage="您的用户名或者密码不正确!";
session.setAttribute("username","");
}
}
%>
<script language="javascript">
function jumptoreg()
{
window.location="reg.jsp";
}
</script>
------解决方案--------------------
Syntax error on token "Invalid Character", ; expected
提示是说 无效字符 期待;
我看了下 是你几个有中文的行后用了全角的分号;
------解决方案--------------------
String errorMessage="请您登录";
errorMessage="您的用户名或者密码不正确!";
errorMessage="登录成功!!!";
看到这些行吗?
后面的分号跟别的分号不同,可能是在中文下输入的.你改下,再试试
代码迷推荐解决方案:org.apache.jasper.JasperException: Unable to compile class,http://www.daimami.com/search?q=2308