jsp獲取properties配置文件中的屬性值


jsp頁面

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
// properties 配置文件名稱
ResourceBundle res = ResourceBundle.getBundle("application");
%>


//獲取properties配置文件中的屬性值
var getDataJsonFreq= <%=res.getString("getDataJsonFreq")%>;
var showAllPointFreq= <%=res.getString("showAllPointFreq")%>;


properties配置文件
##獲取實時數據頻率(1000=1秒)
getDataJsonFreq = 1000;
##頁面刷新頻率(1000=1秒)
showAllPointFreq = 1000;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM