我用一个过滤器来过滤一个文件夹person 只要没登陆就会跳转到login.jsp页面 但是person下面的*.acction /*.do 不能被过滤 大哥们是怎么解决的?
直接在地址栏输入/person /ii.action 还是会执行这个action 怎么过滤掉啊
按道理没登陆是不能访问person下面的东西啊 jsp页面是不能访问了 但是action还是可以执行 真晕

解决方案 »

  1.   

    *.*是不行的 这样tomcat根本就不能启动了~ 
    大哥们没遇到过这样的问题么?
      

  2.   

    那你的你文件下里边有什么东西啊?你写上你要过滤的东西嘛
    /person/*.jsp
    /person/*.html
      

  3.   

    是这样的:
    person下面都是jsp文件 fiter过滤不了action 不知道为什么 
    然后自己又写了一个拦截器专门过滤action来解决的~
      

  4.   

    你的action的path是怎么配置的?
    如果想过滤person下的action,那么action的path应该这样
    在struts-config.xml文件中,
    <action
      path="/person/*.do"
      type=""
    >
    </action>
      

  5.   

    我是采用的webwork(struts2)  action是这样配置的
    <filter>
    <filter-name>struts2</filter-name>
    <filter-class>
    org.apache.struts2.dispatcher.FilterDispatcher
    </filter-class>
    </filter><filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
      

  6.   

    比如
    aaa/xxx.do
    就用/aaa/*来全部过滤掉就好
      

  7.   

    自己写个过滤器啊,实现Filter接口,然后在doFilter方法写自己的逻辑,最后将要过滤的东西比如jsp、servlet、action的路径配置好就可以了~