欢迎光临
我们一直在努力

JAVA:配置文件读取器-JSP教程,Java技巧及代码

建站超值云服务器,限时71元/月

〔config.properties〕

[cms properties]

cmsservername=cms

cmstemplatedirectoryname=template

[time out:minute]

time_out=300000

[administrator setting]

administrator=sa

admingroup=adminrole

[web path setting]

innerresource=/accesscontrol/jsp/innerresource/

[picture path setting]

picturepath=c:/picture/

[log path setting]

logpath=c:/log1/

configbundle.java

package creator.config;

import java.util.missingresourceexception;

import java.util.resourcebundle;

/**

*

* <p>title: configbundle.java</p>

* <p>description: </p>

* <p>copyright: copyright (c) 2004</p>

* <p>company: </p>

* @author tanbo

* @version 1.0

*/

public class configbundle{

private static resourcebundle bundle;

/**

* init()

*/

public configbundle()

{

}

/**

* @function getstring

* @param s string

* @return string

*/

public static string getstring(string s){

string s1 = null;

try{

s1 = getresourcebundle().getstring(s);

}catch(missingresourceexception missingresourceexception){

system.out.println("configbundle:getstring error!"+missingresourceexception.tostring());

}

return s1;

}

/**

* @function getresourcebundle

* @return resourcebundle

*/

private static resourcebundle getresourcebundle(){

if(bundle == null)

bundle = resourcebundle.getbundle("creator.config.config");

return bundle;

}

}

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » JAVA:配置文件读取器-JSP教程,Java技巧及代码
分享到: 更多 (0)

相关推荐

  • 暂无文章