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()啊?求解

解决方案 »

  1.   

    緩存問題,重新布署,先把工程刪了,再導入 !
      

  2.   

    什么意思,我新手,用的记事本编的,这怎么办,重启服务器还行?
      

  3.   

    解决了,不过,这缓存问题怎么引起的?老出这问题,其实一些程序没错,却因为缓存问题运行总提示各种乱七八糟的错误,实际没错,但就是把正确的变成错的,让人纠结啊