本文整理匯總了Java中javax.servlet.FilterConfig.getInitParameter方法的典型用法代碼示例。如果您正苦於以下問題:Java FilterConfig.getInitParameter方法的具體用法?Java FilterConfig.getInitParameter怎麽用?Java FilterConfig.getInitParameter使用的例子?那麽恭喜您, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.servlet.FilterConfig的用法示例。
在下文中一共展示了FilterConfig.getInitParameter方法的18個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的Java代碼示例。
示例1: getProxyuserConfiguration
點讚 3
import javax.servlet.FilterConfig; //導入方法依賴的package包/類
/**
* Returns the proxyuser configuration. All returned properties must start
* with proxyuser.
'
*
* Subclasses may override this method if the proxyuser configuration is
* read from other place than the filter init parameters.
*
* @param filterConfig filter configuration object
* @return the proxyuser configuration properties.
* @throws ServletException thrown if the configuration could not be created.
*/
protected Configuration getProxyuserConfiguration(FilterConfig filterConfig)
throws ServletException {
// this filter class gets the configuration from the filter configs, we are
// creating an empty configuration and injecting the proxyuser settings in
// it. In the initialization of the filter, the returned configuration is
// passed to the ProxyUsers which only looks for 'proxyusers.' properties.
Configuration conf = new Configuration(false);
Enumeration> names = filterConfig.getInitParameterNames();
while (names.hasMoreElements()) {
String name = (String) names.nextElement();
if (name.startsWith(PROXYUSER_PREFIX + ".")) {
String value = filterConfig.getInitParameter(name);
conf.set(name, value);
}
}
return conf;
}
開發者ID:nucypher,項目名稱:hadoop-oss,代碼行數:29,
示例2: init
點讚 3
import javax.servlet.FilterConfig; //導入方法依賴的package包/類
/**
* Place this filter into service.
*
* @param filterConfig The filter configuration object
*/
public void init(FilterConfig filterConfig) throws ServletException {
this.filterConfig = filterConfig;
this.encoding = filterConfig.getInitParameter("encoding");
String value = filterConfig.getInitParameter("ignore");
if (value == null)
this.ignore = true;
else if (value.equalsIgnoreCase("true"))
this.ignore = true;
else if (value.equalsIgnoreCase("yes"))
this.ignore = true;
else
this.ignore = false;
}
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:21,
示例3: init
點讚 3
import javax.servlet.FilterConfig; //導入方法依賴的package包/類
/**
* 方法名稱:初始化
* 概要說明:初始化過濾器
*
* @param fConfig 過濾器配置
* @throws ServletException Servlet異常
* @see Filter#init(FilterConfig)
*/
public void init(FilterConfig fConfig) throws ServletException {
String param = fConfig.getInitParameter(PARAM_KEY_HEADERS);
if (param == null || param.trim().length() < 1) {
return;
}
this.headers = new HashMap();
String[] params = param.split(",");
String[] kvs = null;
for (int i = 0; i < params.length; i++) {
param = params[i];
if (param != null && param.trim().length() > 0) {
kvs = param.split("=");
if (kvs != null && kv