문제

I have a scenario where, if a user gives my Grails app a certain type of input, I want to dynamically add a javax.servlet.Filter impl (MyCustomerFilter) so that all subsequent requests to the server get passed through this filter.

In other words, when the Grails app starts up, MyCustomFilter is not activated and is not in the filter chain. But when the user does something (let's say makes an AJAX call back to a server-side controller) I want to add MyCustomFilter to the filter chain and activate it (for all future/subsequent requests).

Is this possible? If so, how? If not, why?

도움이 되었습니까?

해결책

You can't dynamically add a filter, you can however add filter that either wraps the request or just passes it along the filter chain depending on user input

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top