<%@ page language="java" import="java.util.*,java.io.*,com.tsxy.crm.xditu.DituAction"
contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String mapPathxd = "";
Properties pro = new Properties();
String realpath = request.getRealPath("/WEB-INF/classes");
try{
//读取配置文件
FileInputStream in = new FileInputStream(realpath+"/env.properties");
pro.load(in);
}
catch(FileNotFoundException e){
out.println(e);
}
catch(IOException e){
out.println(e);
}
//通过key获取配置文件
mapPathxd = pro.getProperty("mapPathxd");
%>
获取 var path = '<%=mapPathxd %>';
代码摘自:http://blog.163.com/ygplpr@126/blog/static/3896911620131111228953/