我的ssh2框架中ServletActionContext.getServletContext().getRealPath("/upload")报错,为什么呢?
但是在另外一个项目中正常,哎!拜托哪位大神帮帮我吧!packagecom.action.source;importjava.io.File;importjava.io.F...
但是在另外一个项目中正常,哎!拜托哪位大神帮帮我吧!
package com.action.source;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import org.apache.struts2.ServletActionContext;
import com.bean.source.Source;
import com.opensymphony.xwork2.ActionSupport;
import com.service.SourceService;
public class Save extends ActionSupport {
private File file;
private String fileFileName;
private String fileContentType;
private Source source;
private SourceService sourceService;
String path = ServletActionContext.getServletContext().getRealPath("/upload");
} 展开
package com.action.source;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import org.apache.struts2.ServletActionContext;
import com.bean.source.Source;
import com.opensymphony.xwork2.ActionSupport;
import com.service.SourceService;
public class Save extends ActionSupport {
private File file;
private String fileFileName;
private String fileContentType;
private Source source;
private SourceService sourceService;
String path = ServletActionContext.getServletContext().getRealPath("/upload");
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询