永发信息网

java 过滤器问题 求解..

答案:4  悬赏:70  手机版
解决时间 2021-12-30 16:20
  • 提问者网友:心如荒岛囚我终老
  • 2021-12-30 08:55
web.xml配置:

xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">


contextConfigLocation

/WEB-INF/daoContext.xml,/WEB-INF/utilContext.xml,/WEB-INF/serviceContext.xml,/WEB-INF/applicationContext.xml






org.springframework.web.context.ContextLoaderListener




org.springframework.web.util.IntrospectorCleanupListener






DelegatingFilterProxy

org.springframework.web.filter.DelegatingFilterProxy


targetBeanName
accessFilter


targetFilterLifecycle
true



shieldcount
0



noshieldcount
0





struts2

org.apache.struts2.dispatcher.FilterDispatcher




struts2
*.action



DelegatingFilterProxy
*.action



index.jsp



Spring注入配置:





求解.. 这个过滤器无效果.. 没有进入过滤器的类
最佳答案
  • 五星知识达人网友:逐風
  • 2021-12-30 09:34
按照你上述配置的方式,是所有字符时通过spring的过滤器过滤的,那么这个东西你是看不到的,
然后,你还配置了struts2的过滤器,那么过滤器的路径是*。action 那么只有匹配这种模式才会过滤,你的监听也是监听了这种类型,
解决步骤
尝试将struts2过滤路径改成 /*
全部回答
  • 1楼网友:woshuo
  • 2021-12-30 10:55
要保持整体编码一直 gbk 混着用肯定不行 utf-8 如果有数据库 还要保证底层与代码中设置的统一 不然跨平台移植肯定出问题 如果不想统一 用此方法转码也可以 encoding.getstring();
  • 2楼网友:骨子里都是戏
  • 2021-12-30 10:13
Spring也要配一个类似struts的监听url来调用相关的filter。
  • 3楼网友:轮獄道
  • 2021-12-30 09:48
*.action替换成 /*试试
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯