日期:2014-05-18  浏览次数:20655 次

jsp 这是什么问题?(在线等)
代码如下所示:
<%@ page import="java.io.*,device.*,java.text.*,java.util.Date,java.util.*,java.math.*,java.sql.*,java.net.*,java.lang.*,comm.*"%>
<%
String userid,passwd;
// 从session中取用户名和密码
userid = (String)session.getValue("user_id");
passwd = (String)session.getValue("passwd");

// 如果userid或者passwd为空,则重新登录
try{
if(userid==null || passwd==null)
response.sendRedirect("Login.htm");
else{
// 定义用户对象,设置其用户名和密码
User o_user = new User();
o_user.setUserId(userid);
o_user.setPassWord(passwd);
// 判断是否存在此用户信息,如果不存在此用户则返回登录页面
if(!o_user.getUser())
response.sendRedirect("Login.htm");
}
}catch(Exception e)
  {
e.printStackTrace();
out.println("<br><br><br><center>用户信息查找失败! </center>");
}
%>
<%! 
//判断是否为经理
public boolean isManager(String suid)
{
try{
// 定义用户对象,设置用户名为suid
User o_user = new User();
o_user.setUserId(suid);
// 如果存在此用户,则判断用户类型
if(o_user.getUser())
{
// 如果用户类型为1(部门经理),返回true
if(o_user.getUserType()==1)
return true;
}
}
catch(Exception e)
{
e.printStackTrace();
out.println("<br><br><br><center>sdfgsdfgsdg! </center>");
}
return false;
}
//判断是否为管理员
public boolean isAdmin(String suid)
{
try{
User o_user = new User();
o_user.setUserId(suid);
if(o_user.getUser())
{
if(o_user.getUserType()==2)
return true;
}
}
catch(Exception e)
{
e.printStackTrace();
out.println("<br><br><br><center>qqqqqqqqqqqqqq! </center>");
}
return false;
}
%>

提示的错误如下所示:

type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 27 in the jsp file: /head.jsp
out cannot be resolved
24: out.println("<br><br><br><center>用户信息查找失败! </center>");
25: }
26: %>
27: <%! 
28: //判断是否为经理
29: public Boolean isManager(String suid)
30: {


An error occurred at line: 27 in the jsp file: /head.jsp
out cannot be resolved
24: out.println("<br><br><br><center>用户信息查找失败! </center>");
25: }
26: %>
27: <%! 
28: //判断是否为经理
29: public Boolean isManager(String suid)
30: {


Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.s