放到哪还不是你的action说了算么

解决方案 »

  1.   

    public String execute() throws Exception {

    String realpath=ServletActionContext.getServletContext().getRealPath("/upload");
    System.out.println(realpath);
    if(image!=null){
    File savefile =new File(new File(realpath),imageFileName);
    if(!savefile.getParentFile().exists())savefile.getParentFile().mkdirs();
    FileUtils.copyFile(image, savefile);

    ActionContext.getContext().put("imageFileName", imageFileName);
    ActionContext.getContext().put("realpath", realpath);
    }
    System.out.println(imageFileName);


    return SUCCESS;
    }这是我的action  怎嘛修改啊???