filterconfig 是什么在哪里

具体的使用方法你可以在google上搜索 &filter 过滤器&,FilterConfig可以获取部署描述符文件(web.xml)中分配的过滤器初始化参数。针对你的问题回答,结果就是说FilterConfig可以获得web.xml中,以 filter 作为描述标签内的参数。
定义:FilterConfig对象提供对servlet环境及web.xml文件中指派的过滤器名的访问。FilterConfig对象具有一个getInitParameter方法,它能够访问部署描述符文件(web.xml)中分配的过滤器初始化参数。
实例:将下面的代码加入到web.xml中,试用FilterConfig就可以获得以 filter 作为描述标签内的参数。
&!-- The Cache Filter --&&filter&&!-- 设计过滤处理类,生成静态页面 --&&filter-name&CacheFilter&/filter-name&&filter-class&com.jspbook.CacheFilter&/filter-class&
&!-- 不需要缓存的URL --&&init-param&¶m-name&/TimeMonger.jsp&/param-name&¶m-value&nocache&/param-value&&/init-param&&init-param&¶m-name&/TestCache.jsp&/param-name&¶m-value&nocache&/param-value&&/init-param&&!-- 缓存超时时间, 单位为秒 --&&init-param&¶m-name&cacheTimeout&/param-name&¶m-value&600&/param-value&&/init-param&
&!-- 是否根据浏览器不同的地区设置进行缓存(生成的缓存文件为 test.jspid=1_zh_CN 的格式) --&&init-param&¶m-name&locale-sensitive&/param-name&¶m-value&true&/param-value&&/init-param&
&/filter&&filter-mapping&&filter-name&CacheFilter&/filter-name&&url-pattern&*.jsp&/url-pattern&&/filter-mapping& 用法:
filterConfig.getInitParameter("locale-sensitive"); 得到的就是 turefilterConfig.getInitParameter("cacheTimeout"); 得到的就是 600filterConfig.getInitParameter(request.getRequestURI()); 得到的就是param-name 对应的 param-value 值
过滤处理类:
public class CacheFilter implements Filter {ServletCFilterClong cacheTimeout = Long.MAX_VALUE;
public void doFilter(ServletRequest req, ServletResponse res,FilterChain chain) throws IOException, ServletException {HttpServletRequest request = (HttpServletRequest)HttpServletResponse response = (HttpServletResponse)
// check if was a resource that shouldn't be cached.String r = sc.getRealPath("");String path = fc.getInitParameter(request.getRequestURI());if (path != null && path.equals("nocache")) {chain.doFilter(request, response);}path = r +
public void init(FilterConfig filterConfig) {this.fc = filterCString ct = fc.getInitParameter("cacheTimeout");if (ct != null) {cacheTimeout = 60 * 1000 * Long.parseLong(ct);}this.sc = filterConfig.getServletContext();}
public void destroy() {this.sc =this.fc =}}
阅读(...) 评论()温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
& & Set-ContentFilterConfig摘要& & 使用 Set-ContentFilterConfig cmdlet,可修改***了边缘传输服务器角色或集线器传输服务器角色的计算机上的内容筛选器配置。语法& & Set-ContentFilterConfig [-BypassedRecipients &MultiValuedProperty&] [-BypassedSenderDomains &MultiValuedProperty&]& & [-BypassedSenders &MultiValuedProperty&] [-Confirm [&SwitchParameter&]] [-DomainController &Fqdn&] [-Enabled &$true& & &| $false&] [-ExternalMailEnabled &$true | $false&] [-InternalMailEnabled &$true | $false&] [-OutlookEmailPostmarkV& & alidationEnabled &$true | $false&] [-QuarantineMailbox &SmtpAddress&] [-RejectionResponse &AsciiString&] [-SCLDelet& & eEnabled &$true | $false&] [-SCLDeleteThreshold &Int32&] [-SCLQuarantineEnabled &$true | $false&] [-SCLQuarantineTh& & reshold &Int32&] [-SCLRejectEnabled &$true | $false&] [-SCLRejectThreshold &Int32&] [-WhatIf [&SwitchParameter&]] [& & &CommonParameters&]指定垃圾邮件隔离邮箱例如,若要将超出垃圾邮件隔离的所有邮件发送到 ,请运行以下命令:Set-ContentFilterConfig -QuarantineMailbox ------------
阅读(407)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
在LOFTER的更多文章
loftPermalink:'',
id:'fks_',
blogTitle:'内容筛选器配置:Set-ContentFilterConfig',
blogAbstract:'名称& & Set-ContentFilterConfig摘要& & 使用 Set-ContentFilterConfig cmdlet,可修改***了边缘传输服务器角色或集线器传输服务器角色的计算机上的内容筛选器配置。语法& & Set-ContentFilterConfig [-BypassedRecipients &MultiValuedProperty&] [-BypassedSenderDomains &MultiValuedProperty&]',
blogTag:'',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:0,
publishTime:1,
permalink:'blog/static/',
commentCount:0,
mainCommentCount:0,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'',
hmcon:'1',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}

参考资料

 

随机推荐