{"action":"created","issue":{"url":"https://api.github.com/repos/playframework/playframework/issues/5992","repository_url":"https://api.github.com/repos/playframework/playframework","labels_url":"https://api.github.com/repos/playframework/playframework/issues/5992/labels{/name}","comments_url":"https://api.github.com/repos/playframework/playframework/issues/5992/comments","events_url":"https://api.github.com/repos/playframework/playframework/issues/5992/events","html_url":"https://github.com/playframework/playframework/issues/5992","id":145647015,"number":5992,"title":"DI should work in Forms","user":{"login":"eximius313","id":5578017,"avatar_url":"https://avatars.githubusercontent.com/u/5578017?v=3","gravatar_id":"","url":"https://api.github.com/users/eximius313","html_url":"https://github.com/eximius313","followers_url":"https://api.github.com/users/eximius313/followers","following_url":"https://api.github.com/users/eximius313/following{/other_user}","gists_url":"https://api.github.com/users/eximius313/gists{/gist_id}","starred_url":"https://api.github.com/users/eximius313/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eximius313/subscriptions","organizations_url":"https://api.github.com/users/eximius313/orgs","repos_url":"https://api.github.com/users/eximius313/repos","events_url":"https://api.github.com/users/eximius313/events{/privacy}","received_events_url":"https://api.github.com/users/eximius313/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2016-04-04T10:42:23Z","updated_at":"2016-04-06T09:43:11Z","closed_at":null,"body":"### Play Version (2.5.x / etc)\r\n2.5.1\r\n\r\n### API (Scala / Java / Neither / Both)\r\nJava\r\n\r\n### Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)\r\nN/A\r\n\r\n### JDK (Oracle 1.8.0_72, OpenJDK 1.8.x, Azul Zing)\r\nN/A\r\n\r\n### Library Dependencies\r\nN/A\r\n\r\n### Expected Behavior\r\n1. form validation method need's to use database repository or other DI service\r\n2. Service is being injected into form using ```@Inject```\r\n\r\n### Actual Behavior\r\n1. Using ```@Inject``` on a field is ignored\r\n2. Using ```@Inject``` in constructor throws:```\r\n[CompletionException: java.lang.RuntimeException: Cannot instantiate class controllers.myController.forms.MyForm. It must have a default constructor]```\r\n3. Using ```Play.application().injector().instanceOf(MyService.class)``` is deprecated\r\n"},"comment":{"url":"https://api.github.com/repos/playframework/playframework/issues/comments/206263288","html_url":"https://github.com/playframework/playframework/issues/5992#issuecomment-206263288","issue_url":"https://api.github.com/repos/playframework/playframework/issues/5992","id":206263288,"user":{"login":"mkurz","id":644927,"avatar_url":"https://avatars.githubusercontent.com/u/644927?v=3","gravatar_id":"","url":"https://api.github.com/users/mkurz","html_url":"https://github.com/mkurz","followers_url":"https://api.github.com/users/mkurz/followers","following_url":"https://api.github.com/users/mkurz/following{/other_user}","gists_url":"https://api.github.com/users/mkurz/gists{/gist_id}","starred_url":"https://api.github.com/users/mkurz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkurz/subscriptions","organizations_url":"https://api.github.com/users/mkurz/orgs","repos_url":"https://api.github.com/users/mkurz/repos","events_url":"https://api.github.com/users/mkurz/events{/privacy}","received_events_url":"https://api.github.com/users/mkurz/received_events","type":"User","site_admin":false},"created_at":"2016-04-06T09:43:11Z","updated_at":"2016-04-06T09:43:11Z","body":"If I find some time the next weeks I can try to provide a PR. (I am quite busy now with a new project for a client of mine.) But I don't want to promise anything."}}