本文整理匯總了Java中javax.InitParameter方法的典型用法代碼示例。如果您正苦於以下問題:InitParameter方法的具體用法?InitParameter怎麽用?InitParameter使用的例子?那麽恭喜您, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.servlet.FilterConfig的用法示例。
在下文中一共展示了InitParameter方法的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 = InitParameterNames();
while (names.hasMoreElements()) {
String name = (String) Element();
if (name.startsWith(PROXYUSER_PREFIX + ".")) {
String value = InitParameter(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;
String value = InitParameter("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 = InitParameter(PARAM_KEY_HEADERS);
if (param == null || im().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 && im().length() > 0) {
kvs = param.split("=");
if (kvs != null && kv
本文发布于:2024-01-29 10:56:29,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170649699414790.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |