The method init(String) is undefined for the type GoodsField 在线等!!

zyczy1314 2012-05-09 02:00:48
GoodsField.java
package com.netshop;
import java.sql.*;
import java.text.*;
public class GoodsField extends executeWay
{
private long ID;
private String name;
private int tag;
public GoodsField()
{
ID=0;
name="";
tag=0;
}
public String getName()
{
return this.name;
}
public void setName(String name)
{
this.name=name;
}

public int getTag()
{
return this.tag;
}
public void setTag(int tag)
{
this.tag=tag;
}
public boolean init(String webID)
{
String strSql="select * from goodsField where name='"+webID+"'";
try
{
ResultSet rs=super.exeSqlQuery(strSql);
if(rs.next())
{
ID=rs.getLong("ID");
name=rs.getString("name");
tag=rs.getInt("tag");
return true;
}
else
{
return false;
}
}
catch(Exception ex)
{
System.out.println(ex.toString());
return false;
}
}
}
query.jsp
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="com.netshop.*"%>
<jsp:useBean scope="session" id="at" class="com.netshop.GoodsField"/>
<%
String webID="1";
at.init(webID);
at.getName();
%>

运行时提示The method init(String) is undefined for the type GoodsField
着GoodsField里可是有init()啊?求解
...全文
225 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
zyczy1314 2012-05-09
  • 打赏
  • 举报
回复
解决了,不过,这缓存问题怎么引起的?老出这问题,其实一些程序没错,却因为缓存问题运行总提示各种乱七八糟的错误,实际没错,但就是把正确的变成错的,让人纠结啊
zyczy1314 2012-05-09
  • 打赏
  • 举报
回复
什么意思,我新手,用的记事本编的,这怎么办,重启服务器还行?
小V小V志 2012-05-09
  • 打赏
  • 举报
回复
緩存問題,重新布署,先把工程刪了,再導入 !

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧