linux下获得javaweb路径问题
public static ApplicationContext getApplicationContext(HttpServletRequest request,String name,String name2){
String fs=System.getProperties().getProperty("file.separator");//获得系统文件分隔符
System.out.println("file.separator"+fs);
String path="";
path = request.getSession().getServletContext().getRealPath("/") +"WEB-INF"+fs+name+".xml";
con = new FileSystemXmlApplicationContext(path);
return con;
}
问题:通过获得linux下在jsp页面直接条用这个java方法,提示没有这个文件,但是在window下可以访问到,请高手指教。