首页 > Web开发 > 详细

JSP中获取properties文件属性

时间:2017-05-10 17:32:54      阅读:267      评论:0      收藏:0      [点我收藏+]
<%@ page contentType="text/html;charset=UTF-8" import="java.util.ResourceBundle"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%
    String path = request.getContextPath();
    // properties 配置文件名称
    ResourceBundle res = ResourceBundle.getBundle("test");
%>
<html>
<head>
<script>
    var name=<%=res.getString("name")%>;
</script>
</head>
<body>
</body>
</html>

test为properties文件 , test.properties  , name 为test中的一个属性名称

JSP中获取properties文件属性

原文:http://www.cnblogs.com/lyhappy/p/6837043.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!