Enumeration遍历servlet配置参数的一个例子

public void init(Config config) throws ServletException{

 

    Enumeration paraNames=config.getInitParameterNames();

    for(Enumeration e=paraNames;e.hasMoreElements();){

        String thisName=e.nextElement.toString();

        String thisValue=config.getInitParameter(thisName);

        system.out.println(thisName+"--------------"+thisValue);

    }

你可能感兴趣的:(servlet,String)