Hi Tony,
A very simple way to do this is by subclassing StripesFilter, override
the doFilter(...) method, and perform a test on the requested URL to
decide wether to call the stripes filter (via super.doFilter()), or
just let the request go through and do nothing.
Stuff like this :
class StripesWithExclusionFilter extends StripesFilter {
...
@Override
public void doFilter(request,response,filterChain) {
if (filterExclusionHelper.isExcluded(request)) {
// excluded request
filterChain.doFilter(request, response);
} else {
// request should be handled by Stripes
super.doFilter(...);
}
}
...
}
Of course, you'll need to declare your filter class instead of
Stripes' into web.xml.
Cheers
Remi
2009/6/30 Tony Nelson <[email protected]>:
> Hello everyone.
>
> Thank you for any help in advance.
>
> I have mapped StripesFilter to all .htm files.
>
> <filter-mapping>
> <filter-name>StripesFilter</filter-name>
> <servlet-name>DispatcherServlet</servlet-name>
> <dispatcher>REQUEST</dispatcher>
> <dispatcher>FORWARD</dispatcher>
> </filter-mapping>
>
> <servlet>
> <servlet-name>DispatcherServlet</servlet-name>
>
> <servlet-class>net.sourceforge.stripes.controller.DispatcherServlet</servlet-class>
> <load-on-startup>1</load-on-startup>
> </servlet>
>
> <servlet-mapping>
> <servlet-name>DispatcherServlet</servlet-name>
> <url-pattern>*.htm</url-pattern>
> </servlet-mapping>
>
> This was working just great.. until someone clicked a button on a
> javascript widget (tiny_mce) that caused a popup to open
> (/path/to/tiny_mce/something.htm). Of course Stripes intercepted the
> called and complained that it couldn't find an ActionBean for the page.
>
> I think I have 2 options.
>
> 1) Change my files from .htm to something else. .html and .jsp are
> already taken. My boss wasn't happy with the default .action which is
> why I changed it in the first place. Any suggestions?
>
> 2) Somehow exclude the parent path to the tiny_mce editor. I can
> exclude all of /javascript and should be ok since none of the pages that
> Stripes should be concerned in will live there. I just can't find a
> way to do this. I don't believe the jsp spec allows it, and I can't
> find a configuration parameter for Stripes.
>
> Any help help, ideas or alternate suggestions would be greatly appreciated.
>
> Tony Nelson
> Starpoint Solutions
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
------------------------------------------------------------------------------
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users