ytrstu / vosao

Automatically exported from code.google.com/p/vosao
GNU Lesser General Public License v2.1
0 stars 0 forks source link

customisable SKIP_URLS in doFilter #299

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
doFilter is great.. but.. I can't use appstats or my own custom servlets as a 
result (I have something called /api/resellercontacts that has to be in that 
location).

Line 54 of SiteFilter.java has a final list of urls to skip. Is there an easy 
way we can add to this without having to recompile the code?

Thanks!

Original issue reported on code.google.com by roland.q...@gmail.com on 4 Aug 2010 at 7:02

GoogleCodeExporter commented 8 years ago
Workaround:

You can use /_ah prefix for custom servlets. 

Also plugin can provide servlets which will map to 
/_ah/plugin/NAME/servlet_path (for example look at rssatom plugin)

To develop this feature we have two options:

1. Add ability to extend this list from site configuration by administrator.
2. Add ability for plugins to extend this list.

Both these options require additional calls to datastore/memcache which will 
have performance penalties on every page delivery.

Original comment by kinyelo@gmail.com on 4 Aug 2010 at 9:16

GoogleCodeExporter commented 8 years ago
Also we can make this list as a method:

public List<String> getSkipUrls() {...}

And you will extend this filter class and override this method adding required 
URLs.

Then you will get desired results by replacing filter class in web.xml only.

Original comment by kinyelo@gmail.com on 4 Aug 2010 at 9:21

GoogleCodeExporter commented 8 years ago
Also we can use filter parameters for extending this list. Then you will need 
to change only web.xml!

I think this is a preferred way.

Original comment by kinyelo@gmail.com on 4 Aug 2010 at 9:26

GoogleCodeExporter commented 8 years ago
filter parameters sounds good and safer. I was able to get around the issue by 
creating my own filter and putting the mapping before SiteFilter's mapping. 
Would be good to have exclusions as a list though as you describe.

Original comment by roland.q...@gmail.com on 4 Aug 2010 at 12:27

GoogleCodeExporter commented 8 years ago
Implemented.

Original comment by kinyelo@gmail.com on 7 Aug 2010 at 6:41