J
jbas
Unregistered / Unconfirmed
GUEST, unregistred user!
没有办法,还有错误,javabean怎么用?
TSystemAction.java文件
//系统操作包
package com.beltino.jbas.jforum.jmain;
import java.sql.*;
import java.util.*;
import java.io.*;
import com.beltino.jbas.jforum.util.*;
public class TSystemAction{
//private Connection conn;
//连接数据库
//public TSystemAction(){
// this.conn=DataBaseConnection.getConnection();
//}
//用户验证
public String checkUser(){
//System.out.println("User: " + User);
//System.out.println("Pwd: " + Pwd);
// Statement stmt=conn.createStatement();
//String sql;
// sql="select * from TUser";
// sql=sql+" where UserName='"+User+"' and UserPwd='"+Pwd+"'";
// ResultSet rst=stmt.executeQuery(sql);
// if (rst.next())
return "true";
// else
// return false;
}
}
////checkuser.jsp
<%@ page contentType="text/html;charset=gb2312" language="java"%>
<jsp:useBean id="sysaction" scope="page" class="com.beltino.jbas.jforum.jmain.TSystemAction">
</jsp:useBean>
<%
String user=request.getParameter("user");
String pwd=request.getParameter("password");
out.println(user);
out.println(pwd);
String logined=sysaction.checkUser();
// boolean logined=false;
if (logined=="true"){
//session.setAttribute("sessionUserName",user);
//session.setAttribute("sessionUserPwd",pwd);
//session.setAttribute("sessionLogined","true");
out.println("myok");
//response.sendRedirect("index.jsp?logined=true");
}
else
{
out.println("false");
//response.sendRedirect("index.jsp?logined=false");
}
%>
提示错误:
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: com.beltino.jbas.jforum.jmain.TSystemAction.checkUser()Ljava/lang/String;
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
org.apache.jsp.WebApp.CheckUser_jsp._jspService(CheckUser_jsp.java:77)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
root cause
java.lang.NoSuchMethodError: com.beltino.jbas.jforum.jmain.TSystemAction.checkUser()Ljava/lang/String;
org.apache.jsp.WebApp.CheckUser_jsp._jspService(CheckUser_jsp.java:58)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
note The full stack trace of the root cause is available in the Tomcat logs.
--------------------------------------------------------------------------------
Apache Tomcat/5.0.16
帮忙了!
TSystemAction.java文件
//系统操作包
package com.beltino.jbas.jforum.jmain;
import java.sql.*;
import java.util.*;
import java.io.*;
import com.beltino.jbas.jforum.util.*;
public class TSystemAction{
//private Connection conn;
//连接数据库
//public TSystemAction(){
// this.conn=DataBaseConnection.getConnection();
//}
//用户验证
public String checkUser(){
//System.out.println("User: " + User);
//System.out.println("Pwd: " + Pwd);
// Statement stmt=conn.createStatement();
//String sql;
// sql="select * from TUser";
// sql=sql+" where UserName='"+User+"' and UserPwd='"+Pwd+"'";
// ResultSet rst=stmt.executeQuery(sql);
// if (rst.next())
return "true";
// else
// return false;
}
}
////checkuser.jsp
<%@ page contentType="text/html;charset=gb2312" language="java"%>
<jsp:useBean id="sysaction" scope="page" class="com.beltino.jbas.jforum.jmain.TSystemAction">
</jsp:useBean>
<%
String user=request.getParameter("user");
String pwd=request.getParameter("password");
out.println(user);
out.println(pwd);
String logined=sysaction.checkUser();
// boolean logined=false;
if (logined=="true"){
//session.setAttribute("sessionUserName",user);
//session.setAttribute("sessionUserPwd",pwd);
//session.setAttribute("sessionLogined","true");
out.println("myok");
//response.sendRedirect("index.jsp?logined=true");
}
else
{
out.println("false");
//response.sendRedirect("index.jsp?logined=false");
}
%>
提示错误:
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: com.beltino.jbas.jforum.jmain.TSystemAction.checkUser()Ljava/lang/String;
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
org.apache.jsp.WebApp.CheckUser_jsp._jspService(CheckUser_jsp.java:77)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
root cause
java.lang.NoSuchMethodError: com.beltino.jbas.jforum.jmain.TSystemAction.checkUser()Ljava/lang/String;
org.apache.jsp.WebApp.CheckUser_jsp._jspService(CheckUser_jsp.java:58)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
note The full stack trace of the root cause is available in the Tomcat logs.
--------------------------------------------------------------------------------
Apache Tomcat/5.0.16
帮忙了!