String nameOfTextFile = "count.txt";
-->
String nameOfTextFile = "/tomcat/webapps/ROOT/";
-->
String nameOfTextFile = "/tomcat/webapps/ROOT/";
解决方案 »
- java.lang.reflect.InvocationTargetException,在线等待!!!
- java菜鸟求助!
- 打印出来排序后全部都是0
- 从mysql中取出中文后显示为?是怎么回事
- 新手求教,求三角形的画法
- 关于ORACLE存储过程返回可滚动游标的问题,急球相关解决思路?
- 小妹才26分了,请问用java做一个b/s结构的矢量画图工具要用到那些技术呀?
- 自己定义的软件包应该放在哪里?
- 一个数据类型的问题!
- 为什么我下载的JAVA入门经典只有第一、二和十五章,有哪位朋友下载到全的,告诉我啊。JAVA入门的书哪位比较好啊?
- jdbc访问Sybase中文乱码?请大家帮帮忙!先谢了!
- 如何给一个只知道名字的JFrame增加响应全局性HotKey的Key Event呀?急急急
String nameOfTextFile = "count.txt";
-->
String nameOfTextFile = "/tomcat/webapps/ROOT/count.txt";
String nameOfTextFile = "count.txt";
file = new BufferedReader(new FileReader(nameOfTextFile));
-->
String nameOfTextFile = "count.txt";
file = new BufferedReader(new FileReader(request.getRealPath(nameOfTextFile)));
<%@ page contentType="text/html;charset=gb2312" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="KEYWORDS" content="fsdfsdfsdf">
<title>fdsdfsdfsdf</title>
<link rel=stylesheet href="style.css" type="text/css">
</head>
<body>
<p> </p>
<%@ page import="java.io.*" %><%
String currentRecord = null;
BufferedReader file; String nameOfTextFile = "count.txt";
file = new BufferedReader(new FileReader(request.getRealPath(nameOfTextFile)));
String readStr =null;
int writeStr =0;
try
{ readStr = file.readLine(); }
catch (IOException e)
{ System.out.println("dsdfgdfg"); }
if (readStr == null) readStr = "dfgdsfgdsfg";
else { writeStr = Integer.parseInt(readStr)+1;}try {
PrintWriter pw = new PrintWriter(new FileOutputStream(request.getRealPath(nameOfTextFile)));
pw.println(writeStr);
pw.close();}catch(IOException e) {
out.println(e.getMessage());
}
%>
<p align="center">dffgdsg<b><font color="red"><%=writeStr%></font></b>gfhdfghdsf</p>
<br><br>
<center>
<table width="70%">
<tr>
<td align="center" width="20%"><a href="login.jsp">dfgdfg</a></td>
<td align="center" width="20%"><a href="register.jsp">dfgsdg</a></td>
<td align="center" width="20%"><a href="shade.jsp">fghfg</a></td>
<td align="center" width="20%"><a href="appriciate.jsp">ghfghh</a></td>
<td align="center" width="20%"><a href="forum.jsp">fgdfgh</a></td>
</tr>
</table>
</center>
<p> </p>
</body>
</html>