String name = (String) session.getValue("username");
// Variables
int count=0;
// Initialization
mySmartUpload.initialize(pageContext);
// Upload
mySmartUpload.upload();
// Select each file
for (int i=0;i<mySmartUpload.getFiles().getCount();i++){
// Retreive the current file
com.jspsmart.upload.File myFile = mySmartUpload.getFiles().getFile(i);
// Save it only if this file exists
if (!myFile.isMissing()) {
// Save the files with its original names in a virtual path of the web server
myFile.saveAs("/upload/" + myFile.getFileName());
// myFile.saveAs("/upload/" + myFile.getFileName(), mySmartUpload.SAVE_VIRTUAL);
// sample with a physical path
// myFile.saveAs("c:\\temp\\" + myFile.getFileName(), mySmartUpload.SAVE_PHYSICAL);
File d = new File(path);
//建立代表目前目录位置的File件, 并由d件变数引用
File list[] = d.listFiles();
//取得代表目录中所有文件的File件阵列
int j=list.length-3;
int i =0;
while(j>0)
{
%>
<option value="<%=list[i]%>"><%=list[i]%></option>
<%
i++;
j--;
}
%>
</select>
<select name="Year" size="1">
<%
Date today = new Date();
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
String sToday = format.format(today);
int lToday = Integer.parseInt(sToday);
int w = lToday%10000;
int ww=(lToday-w)/10000;
在问大家一个问题!!!
500 Servlet Exception
java.lang.NullPointerException
at java.io.File.<init>(File.java:180)
at _programe._uploadfile._upload__jsp._jspService (/programe/uploadFile/upload.jsp:47)
at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
这样的异常怎么解决???由什么引起的,应该怎么着手解决???
我用的是resin,请各位帮忙了!!!!