首页上一页 1 下一页尾页 1 条记录 1/1页
java项目开发全程实录
发表在JavaWeb图书答疑
2010-06-04
是否精华
是
否
版块置顶:
是
否
里面有多处错误问题:
1.登陆后台报错,具体如下:
ype Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.IncompatibleClassChangeError: Expected static method com.wsy.selectsql.check(Ljava/lang/String;Ljava/lang/String;)I
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
javax.servlet.ServletException: java.lang.IncompatibleClassChangeError: Expected static method com.wsy.selectsql.check(Ljava/lang/String;Ljava/lang/String;)I
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.houtai.houtaitest_jsp._jspService(houtaitest_jsp.java:113)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
这个问题是连接不上数据库,无法登陆,是
public static int check(String name,String password){
int i=0;
String names="";
String passwords="";
try{
connsqlserver connsqlserver=new connsqlserver();
String sql="select * from tb_usertable where name='"+name+"'and password='"+password+"'";
System.out.println(sql);
rs=connsqlserver.executeQuery(sql);
while(rs.next()){
names=rs.getString("name");
passwords=rs.getString("password");
if(names!=null){
i=1;
}
}
}
catch(Exception e){
e.printStackTrace();
}
connsqlserver.close();
return i;
}
这个函数出问题了。
2.下面一块代码有问题,报错。
<tr>
<td colspan="2" rowspan="2" width="405" height="20"><table width="100%" border="0" background="images/17.gif" height="20">
<%Collection temp2=sql.selectNews();
Iterator it2=temp2.iterator();
while(it2.hasNext()){
news news=(news)it2.next();%>
<tr>
<td width="4%" class="zczi"> </td>
<td width="96%" class="zczi"><%=news.getTitle() %></td>
</tr>
<!-- 分栏显示 -->
<%
//int RowCount = sql.selectCountBusiness();//记录数
int RowCount=4;
ResultSet Rs = sql.selectbusiness();
int HRow = RowCount/2;//行数
if (RowCount%2>0)
HRow++;
for (int i = 0 ;i<HRow;i++){%>
<%
for (int j=i*2+1;j<=(i+1)*2;j++){
Rs.absolute(j);
if (Rs.isAfterLast())
break;
%>
具体是:Collection temp2=sql.selectNews();这个函数调用出错。
3.产品介绍的页面出错,具体是下面代码:
<!-- 分栏显示 -->
<%
//int RowCount = sql.selectCountBusiness();//记录数
int RowCount=6;
ResultSet Rs = sql.selectbusiness();
int HRow = RowCount/2;//行数
if (RowCount%2>0)
HRow++;
for (int i = 0 ;i<HRow;i++){%>
<%
for (int j=i*2+1;j<=(i+1)*2;j++){
Rs.absolute(j);
if (Rs.isAfterLast())
break;
%>
中的,ResultSet Rs = sql.selectbusiness();
看到后麻烦快速帮我解决一下。
1.登陆后台报错,具体如下:
ype Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.IncompatibleClassChangeError: Expected static method com.wsy.selectsql.check(Ljava/lang/String;Ljava/lang/String;)I
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
javax.servlet.ServletException: java.lang.IncompatibleClassChangeError: Expected static method com.wsy.selectsql.check(Ljava/lang/String;Ljava/lang/String;)I
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.houtai.houtaitest_jsp._jspService(houtaitest_jsp.java:113)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
这个问题是连接不上数据库,无法登陆,是
public static int check(String name,String password){
int i=0;
String names="";
String passwords="";
try{
connsqlserver connsqlserver=new connsqlserver();
String sql="select * from tb_usertable where name='"+name+"'and password='"+password+"'";
System.out.println(sql);
rs=connsqlserver.executeQuery(sql);
while(rs.next()){
names=rs.getString("name");
passwords=rs.getString("password");
if(names!=null){
i=1;
}
}
}
catch(Exception e){
e.printStackTrace();
}
connsqlserver.close();
return i;
}
这个函数出问题了。
2.下面一块代码有问题,报错。
<tr>
<td colspan="2" rowspan="2" width="405" height="20"><table width="100%" border="0" background="images/17.gif" height="20">
<%Collection temp2=sql.selectNews();
Iterator it2=temp2.iterator();
while(it2.hasNext()){
news news=(news)it2.next();%>
<tr>
<td width="4%" class="zczi"> </td>
<td width="96%" class="zczi"><%=news.getTitle() %></td>
</tr>
<!-- 分栏显示 -->
<%
//int RowCount = sql.selectCountBusiness();//记录数
int RowCount=4;
ResultSet Rs = sql.selectbusiness();
int HRow = RowCount/2;//行数
if (RowCount%2>0)
HRow++;
for (int i = 0 ;i<HRow;i++){%>
<%
for (int j=i*2+1;j<=(i+1)*2;j++){
Rs.absolute(j);
if (Rs.isAfterLast())
break;
%>
具体是:Collection temp2=sql.selectNews();这个函数调用出错。
3.产品介绍的页面出错,具体是下面代码:
<!-- 分栏显示 -->
<%
//int RowCount = sql.selectCountBusiness();//记录数
int RowCount=6;
ResultSet Rs = sql.selectbusiness();
int HRow = RowCount/2;//行数
if (RowCount%2>0)
HRow++;
for (int i = 0 ;i<HRow;i++){%>
<%
for (int j=i*2+1;j<=(i+1)*2;j++){
Rs.absolute(j);
if (Rs.isAfterLast())
break;
%>
中的,ResultSet Rs = sql.selectbusiness();
看到后麻烦快速帮我解决一下。