{"action":"created","issue":{"url":"https://api.github.com/repos/dandelion/dandelion-datatables/issues/266","labels_url":"https://api.github.com/repos/dandelion/dandelion-datatables/issues/266/labels{/name}","comments_url":"https://api.github.com/repos/dandelion/dandelion-datatables/issues/266/comments","events_url":"https://api.github.com/repos/dandelion/dandelion-datatables/issues/266/events","html_url":"https://github.com/dandelion/dandelion-datatables/issues/266","id":46709963,"number":266,"title":"DandelionFilter gets called twice in spring boot 1.1.8.RELEASE","user":{"login":"nisuhw","id":3644433,"avatar_url":"https://avatars.githubusercontent.com/u/3644433?v=3","gravatar_id":"","url":"https://api.github.com/users/nisuhw","html_url":"https://github.com/nisuhw","followers_url":"https://api.github.com/users/nisuhw/followers","following_url":"https://api.github.com/users/nisuhw/following{/other_user}","gists_url":"https://api.github.com/users/nisuhw/gists{/gist_id}","starred_url":"https://api.github.com/users/nisuhw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nisuhw/subscriptions","organizations_url":"https://api.github.com/users/nisuhw/orgs","repos_url":"https://api.github.com/users/nisuhw/repos","events_url":"https://api.github.com/users/nisuhw/events{/privacy}","received_events_url":"https://api.github.com/users/nisuhw/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dandelion/dandelion-datatables/labels/status:underevaluation","name":"status:underevaluation","color":"5319e7"},{"url":"https://api.github.com/repos/dandelion/dandelion-datatables/labels/tracker:problem","name":"tracker:problem","color":"fc2929"},{"url":"https://api.github.com/repos/dandelion/dandelion-datatables/labels/version:0.10.x","name":"version:0.10.x","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-10-24T07:08:08Z","updated_at":"2015-09-11T13:25:06Z","closed_at":null,"body":"When I declare DatatablesFilter in my Spring Boot application as follow:\r\n    @Bean\r\n    FilterRegistrationBean dandelionFilter() {\r\n        new FilterRegistrationBean(new DandelionFilter())\r\n    }\r\nThe Filter gets called twice so resulting duplicate <script src=\"...dandelion-datatables-0.10.0.js\"> and a javascript alert that complains about that.\r\n\r\nThe temporary workaround is by overriding the method isRelevant to check whether the dandelion-datatables-0.10.0.js already declared or not, as follow:\r\n@Bean\r\n    FilterRegistrationBean dandelionFilter() {\r\n        new FilterRegistrationBean(new DandelionFilter() {\r\n            @Override\r\n            boolean isRelevant(HttpServletRequest request, ByteArrayResponseWrapper wrappedResponse) {\r\n                if (!super.isRelevant(request, wrappedResponse))\r\n                    return false;\r\n                return !(new String(wrappedResponse.toByteArray()).contains(\"dandelion-datatables-0.10.0.js\"))\r\n            }\r\n        })\r\n    }"},"comment":{"url":"https://api.github.com/repos/dandelion/dandelion-datatables/issues/comments/139544849","html_url":"https://github.com/dandelion/dandelion-datatables/issues/266#issuecomment-139544849","issue_url":"https://api.github.com/repos/dandelion/dandelion-datatables/issues/266","id":139544849,"user":{"login":"ForNeVeR","id":92793,"avatar_url":"https://avatars.githubusercontent.com/u/92793?v=3","gravatar_id":"","url":"https://api.github.com/users/ForNeVeR","html_url":"https://github.com/ForNeVeR","followers_url":"https://api.github.com/users/ForNeVeR/followers","following_url":"https://api.github.com/users/ForNeVeR/following{/other_user}","gists_url":"https://api.github.com/users/ForNeVeR/gists{/gist_id}","starred_url":"https://api.github.com/users/ForNeVeR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ForNeVeR/subscriptions","organizations_url":"https://api.github.com/users/ForNeVeR/orgs","repos_url":"https://api.github.com/users/ForNeVeR/repos","events_url":"https://api.github.com/users/ForNeVeR/events{/privacy}","received_events_url":"https://api.github.com/users/ForNeVeR/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T13:25:06Z","updated_at":"2015-09-11T13:25:06Z","body":"I have the same problem. Yes, it does happen when I have embedded templates (using Thymeleaf layout dialect, for example). What can I do as a workaround?"}}