技嘉主板用什么内存条H110 S2主板支持什么牌子的内存的,卡槽DDR4

Filter中注入spring - 折翼只为爱 - ITeye技术网站
博客分类:
当我们用Filter时,往往需要使用一些辅助的service,在普通的java中,只要声明(set,get方法)后在spring-application配置文件中配置就可以了,但是由于Filter与Listener需要配置在web.xml文件中,所以它们的对象是由容器创建的。通常在Spring的application-context.xml配置文件中编写的bean由Spring负责创建,所以直接在Spring配置文件配置过滤器与监听器是无法达到注入目的的。
可以使用如下方法,例:
public class JudgeUserRole implements Filter {
private UserRelationService userRelationS
public UserRelationService getUserRelationService() {
return userRelationS
public void setUserRelationService(UserRelationService userRelationService) {
this.userRelationService = userRelationS
public void destroy() {
public void doFilter(ServletRequest arg0, ServletResponse arg1,
FilterChain arg2) throws IOException, ServletException {
UserRelationship user = this.userRelationService.checkRelationship(0, "jnduan", 0, "cscs01");
public void init(FilterConfig config) throws ServletException {
ServletContext context = config.getServletContext();
ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(context);
userRelationService = (UserRelationService) ctx.getBean("userRelationService");
ps: userRelationService为在spring-application中配置的
浏览 11391
public class MyFilter implements Filter, ApplicationContextAware {
private AccountManager accountM
@PostConstruct
public void init(FilterConfig filterConfig) throws ServletException {
// TODO Auto-generated method stub
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
// TODO Auto-generated method stub
public void destroy() {
// TODO Auto-generated method stub
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
accountManager = applicationContext.getBean(AccountManager.class);
}你在瞎扯,ApplicationAwaried难道不是spring管理的,filter里面都还没有spring管理的东西
浏览: 296628 次
来自: 北京
分布一个Dubbo分布式架构项目实战参考内容:http://w ...
无意中看见了,给悦神赞一个!
zy 写道bewithme 写道Ffmpeg ...
bewithme 写道Ffmpeg 这个类哪里来的?楼主你偷来 ...
Ffmpeg 这个类哪里来的?楼主你偷来的吗?2015年5月 Java大版内专家分月排行榜第二2013年5月 Java大版内专家分月排行榜第二
2011年5月 Java大版内专家分月排行榜第三2011年1月 Java大版内专家分月排行榜第三
匿名用户不能发表回复!|
每天回帖即可获得10分可用分!小技巧:
你还可以输入10000个字符
(Ctrl+Enter)
请遵守CSDN,不得违反国家法律法规。
转载文章请注明出自“CSDN(www.csdn.net)”。如是商业用途请联系原作者。

我要回帖

更多关于 技嘉主板内存超频设置 的文章

 

随机推荐