jsp reads the configuration file properties

The appConfig.properties on the classpath, which is under src, document reads as follows:

BAIDU=http://www.baidu.com
GOOGLE=https://www.google.com

In the jsp written as follows:

<%@ page language="java" import="java.util.ResourceBundle" %>
<head>
<%ResourceBundle res=ResourceBundle.getBundle("appConfig"); %>
</head>
<body>
<a  href="<%=res.getString("BAIDU")%>" target="view_window">百度</a>
<a  href="<%=res.getString("GOOGLE")%>" target="view_window">谷歌</a>
</body>

Guess you like

Origin blog.csdn.net/weixin_44919928/article/details/91656623