简体   繁体   中英

how to retrieve parameters in web.xml jboss

made an application api rest and I need to recover parameters web.xml but not as I am using jboss 7.1

WEB-INF
     --lib
        --web.xml

You'll need access to the ServletContext . You can get it in different ways depending on where you want access to the context-param .

You can then call its getInitParameter(String) method

ServletContext ctx = ...;
String value = ctx.getInitParameter("your-param-name");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM