Yeah sorry, of course dispatcher servlet IS the one to be subclassed... You don't really need to subclass the filter actually I think.
Cheers Remi 2009/6/30 Tony Nelson <[email protected]>: > Hi Remy, and everyone else. > > It looks like the DispatcherServlet is still intercepting the call.. I'm > sure that my Filter class is being used.. and that it's calling > filterChain.doFilter() and not super.doFilter() .. > > 30 Jun 2009 15:37:24,784 [27391...@qtp0-0] DEBUG > com.starpoint.instihire.web.stripes.filter.IHStripesFilter:23 - > /instihire/javascript/tiny_mce/plugins/paste/pasteword.htm > 30 Jun 2009 15:37:24,785 [27391...@qtp0-0] DEBUG > com.starpoint.instihire.web.stripes.filter.IHStripesFilter:27 - calling > filterChain.doFilter() > > On second thought that makes a lot of sense as the DispatcherServlet is > actually what's mapped to *.htm > > Do I need to sublclass DispatcherServlet? Or is there a way to configure > it? > > Thank you for your help. > > Tony > > VANKEISBELCK Remi wrote: > > 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 > ------------------------------------------------------------------------------ _______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users
