请教 class的问题
我自己写了一个class,然后在jsp中调用,结果报错,错误如下:
Generated servlet error:
bad class file: D:\Tomcat\shared\classes\shecasafeapi\ReadConfInfo.class
class file contains wrong class: ReadConfInfo
Please remove or make sure it appears in the correct subdirectory of the classpath.
我得class的内容如下:
import java.io.*;
public class ReadConfInfo
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
private String filePath;
private BufferedReader file;
public void setFilePath(String Path)
{
filePath = filePath;
}
public String getValue(String strTitle)
{
String strLine;
String strValue = null;
String strTmp;
char FirstChar;
int nIndex;
try
{
file = new BufferedReader(new FileReader(filePath));
}
catch (IOException e)
{
System.out.println("读文件错误");
return null;
}
try
{
while( (strLine = (file.readLine()).trim() )!=null)
{
if ((strLine.length()) != 0)
{
FirstChar = strLine.charAt(0);
if ( (FirstChar != '`') && (FirstChar != '#') && (FirstChar != '['))
{
strTmp = strTitle;
nIndex = strLine.indexOf(strTmp);
}
}
}
}
catch(IOException e)
{
return null;
}
return strValue;
}
}