[MAGNOLIA-4396] Servlets should be able to use @Inject Created: 26/Apr/12 Updated: 20/Aug/13 Resolved: 14/Aug/13 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | core |
| Affects Version/s: | 4.5.2 |
| Fix Version/s: | 5.1 |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Magnolia International | Assignee: | Mikaël Geljić |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Template: |
|
||||||||||||||||||||||||||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||||||||||||||||||||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||||||||||||||||||||||||||||||
| Release notes required: |
Yes
|
||||||||||||||||||||||||||||||||||||
| Description |
|
A servlet currently can't benefit from IoC, because ServletDispatchingFilter instantiates the servlet with Classes.newInstance(servletClass). One way around this would be to have ComponentProvider injected in ServletDispatchingFilter, and have ServletDispatchingFilter thus call ComponentProvider.newInstance instead. |
| Comments |
| Comment by Magnolia International [ 12/Aug/13 ] |
|
Here's a quick patch. To test and review ! |