<%
String loginerror = null;
String userName = request.getParameter("username");
String passWord = request.getParameter("password");
%>
<TABLE bgColor=<%=tablebgcolor%> border=0 cellPadding=0 cellSpacing=1 width=400 align=CENTER>
<TR><TD align=middle background=img/index/topback.gif height=10></TD></TR>
</TABLE>
<%
if("".equals(userName)) {
loginerror = "请输入您的用户名!";
}
if("".equals(passWord)) {
loginerror = "请输入您的密码!";
}
try{
DispMaster dispmaster = new DispMaster();
dispmaster.setUserName(userName);
dispmaster.setUserPassword(passWord);
if(!dispmaster.chkLogin()){
loginerror = "用户名或密码错误!请重新登陆。";
%>
帮我看看这段代码中的DispMaster dispmaster = new DispMaster(); 和MasterControl mastercontrol = new MasterControl();
是什么意思
org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 28 in the jsp file: /news/admin/chklogin.jsp
DispMaster cannot be resolved to a type
25:  loginerror = "请输入您的密码!";
26: }
27: try{
28:  DispMaster dispmaster = new DispMaster();
29:  dispmaster.setUserName(userName);
30:  dispmaster.setUserPassword(passWord);
31:  if(!dispmaster.chkLogin()){
An error occurred at line: 28 in the jsp file: /news/admin/chklogin.jsp
DispMaster cannot be resolved to a type
25:  loginerror = "请输入您的密码!";
26: }
27: try{
28:  DispMaster dispmaster = new DispMaster();
29:  dispmaster.setUserName(userName);
30:  dispmaster.setUserPassword(passWord);
31:  if(!dispmaster.chkLogin()){
An error occurred at line: 45 in the jsp file: /news/admin/chklogin.jsp
MasterControl cannot be resolved to a type
42:  String passWord_s = null;
43:  session.setAttribute("userName_s",userName);
44:  session.setAttribute("passWord_s",passWord);
45:  MasterControl mastercontrol = new MasterControl();
46:  mastercontrol.setUserName(userName);
47:  mastercontrol.addloginnum();
48:  response.sendRedirect("main.jsp");
An error occurred at line: 45 in the jsp file: /news/admin/chklogin.jsp
MasterControl cannot be resolved to a type
42:  String passWord_s = null;
43:  session.setAttribute("userName_s",userName);
44:  session.setAttribute("passWord_s",passWord);
45:  MasterControl mastercontrol = new MasterControl();
46:  mastercontrol.setUserName(userName);
47:  mastercontrol.addloginnum();
48:  response.sendRedirect("main.jsp");JSP出错怎么办

解决方案 »

  1.   

    就是说你的JSP程序没有找到DispMaster 这个类
    你需要在JSP页面的开头,通过
    <%@ page import="DispMaster所在的包"%>
    把这个类引入进来MasterControl 也是同样的道理
      

  2.   


    jsp就是一个servlet类,你在servlet里使用一个类,需要import 类所在的包
    在jsp页面当然也需要了啊