取文件路径

CommonTool.class.getClassLoader().getResource("NE.txt").getPath()

Properties temp = new Properties();
    temp.load(CommonFunction.class.getClassLoader().getResourceAsStream ("FoundIndex.properties"));

Resource resource = new ClassPathResource("workTime.xml");
  System.out.println( 
    resource.getFile().getPath()
   );

//取当前路径 
import java.util.Properties; 
Properties properties = System.getProperties(); 
System.out.println(properties.getProperty("user.dir")); 
//jsp取启动路径 
String dir = application.getRealPath("/"); 
String path =ClassLoader.getSystemClassLoader().getResource("Res/ITNMprj.exe").getPath();

你可能感兴趣的:(java,jsp,xml)