>>473

<%@ page contentType="text/html; charset=shift_jis" %>
<%! //宣言の中
private static String fileName;
/*
static {
String thisName = request.getServletPath();
fileName = application.getRealPath(
thisName.substring(0,thisName.lastIndexOf("/")))+"/test.txt";
}
*/
%>
<% //スクリプトレットの中
String thisName = request.getServletPath();
fileName = application.getRealPath(
thisName.substring(0,thisName.lastIndexOf("/")))+"/test.txt";
%>
カレントディレクトリのファイル <%= fileName %>

↑の通りです
static initializer のコメントはずすとできません
できない理由はわかりますが
他の方法を探しています
分かりますか?