try {
       SmartUpload mySmartUpload=new SmartUpload(); 
       mySmartUpload.initialize(pageContext);
       mySmartUpload.upload();
       String currentPath=mySmartUpload.getRequest().getParameter("currentPath");
       
       int count= mySmartUpload.save(currentPath);    
       out.println("<script language=javascript>");
       out.println("alert('"+count + "个文件上传成功.请返回');");
       out.println("location.href=\"index.jsp?currentPath="+currentPath+"\";");
       out.println("</script>");
}catch (Exception e) { 
       out.println("<script language=javascript>");
   out.println("alert(\""+e.toString()+"\");");
       out.println("history.go(-1);");
       out.println("</script>");
}

解决方案 »

  1.   

    这个问题很好解决,你把smartupload的使用方法再看看,在接收页面中,不能在使用JSP中的request方法,要用smartupload中提供的request的方法来接收表格内的内容。
    Request类 
    这个类的功能等同于JSP内置的对象request。只所以提供这个类,是因为对于文件上传表单,通过request对象无法获得表单项的值,必须通过jspSmartUpload组件提供的Request对象来获取。该类提供如下方法: 
    1、getParameter 
    作用:获取指定参数之值。当参数不存在时,返回值为null。 
    原型:public String getParameter(String name)。其中,name为参数的名字。
    实例:<jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" />
    <%
    com.jspsmart.upload.Request myrequest=mySmartUpload.getRequest();
    %>
    然后再用myrequest.getParameter()代替request.getParameter()
    就OK了