[英]Jasper reports are missing in Eclipse metadata folder
您如何嘗試訪問文件? 使用java.io.File
嗎?
嘗試使用絕對路徑,例如/home/kavi/dev/workspace/inqc/Blank_A4_Landscape.jasper
,而不是通過.metadata
文件夾進行瀏覽,看看它是否有效。
更新:
一個示例jsp文件,該文件從.txt文件讀取文本並進行打印。
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" import="java.io.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%
String s = null;
try {
BufferedReader reader = new BufferedReader(new FileReader(new File("C:/Eclipse/workspace/Temp/sample.txt")));
s = reader.readLine();
} catch (Exception e) {
e.printStackTrace();
}
%>
<p>String is <%=s %></p>
</body>
</html>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.