当我输入 url: http://localhost:8080/project/main.html登陆的拦截器没提示任何东西。也就是说根本没通过拦截器这是为什么呢。当session为空的时候拦截器是正常的现在直接访问url却不提示~~~求解答 谢谢 我的web.xml主要内容是 <filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

解决方案 »

  1.   

    不知道是我理解错了,还是你理解错了,拦截器本来就是拦截action的,他拦截不了html.和jsp
      

  2.   

    今天刚做了struts2的拦截器,好像可以,楼主不会是struts.xml配置少配了啥吧
      

  3.   

    拦截器 只能拦截 通过action的请求 如何要拦截页面的话 过滤器吧
      

  4.   

    的确 今天下午我试了在web.xml配置个过滤器 成功过滤直接输入网址访问的问题 thanks.
      

  5.   

    看看这个帖子,有说到这么拦截html的
    http://bbs.csdn.net/topics/310023756