得到web.xml中servletContext的context-param

import org.springframework.web.context.ContextLoader;

// web.xml文件中已经启用数据权限
            String enableDataSecurity = ContextLoader.getCurrentWebApplicationContext().getServletContext().getInitParameter("EnableDataSecurity");
            

 

web.xml

    <!-- Enable data security -->
    <context-param>
        <param-name>EnableDataSecurity</param-name>
        <param-value>true</param-value>
    </context-param>

 

posted @ 2017-12-05 10:53  tonggc1668  阅读(94)  评论(0编辑  收藏  举报