java jsp网页无法显示_jsp网页显示不了
Read.jsp
读取一个文件Read.jsp
读取一个文件文件内容:
第行:
//DelimitedDataFile.java bean文件源代码
//导入java包
import java.io.*;
import java.util.StringTokenizer;
public class DelimitedDataFile
{
private String currentRecord = null;
private BufferedReader file;
private String path;
private StringTokenizer token;
//创建文件对象
public DelimitedDataFile()
{
file = new BufferedReader(new InputStreamReader(System.in),1);
}
public DelimitedDataFile(String filePath) throws FileNotFoundException
{
path = filePath;
file = new BufferedReader(new FileReader(path));
}
//设置文件路径
public void setPath(String filePath)
{
path = filePath;
try {
file = new BufferedReader(new
FileReader(path));
} catch (FileNotFoundException e) {
System.out.println("file not found");
}
}
//得到文件路径
public String getPath() {
return path;
}
//关闭文件
public void fileClose() throws IOException
{
file.close();
}
//读取下一行记录,若没有则返回-1
public int nextRecord()
{
int returnInt = -1;
try
{
currentRecord = file.readLine();
}
catch (IOException e)
{
System.out.println("readLine problem, terminating.");
}
if (currentRecord == null)
returnInt = -1;
else
{
token = new StringTokenizer(currentRecord);
returnInt = token.countTokens();
}
return returnInt;
}
//以字符串的形式返回整个记录
public String returnRecord()
{
return currentRecord;
}
}
E:\Program Files\Java\jswdk-1.0.1\examples\WEB-INF\jsp\beans这个下面方.java和.class文件
E:\Program Files\Java\jswdk-1.0.1\examples这个下面放read.jsp文件
访问http://127.0.0.1:808/examples/read.jsp就显示Error: 500
Unable to compile class for JSP
这个给java文件加了test包了就不是找不到类,而是在命令提示符下显示file not found,我又应该怎么办,是不是所读文件路径找不到呀?应该把所读文件放在什么地方呢?
展开