[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: Text File MAGNOLIA-4396.patch    
Issue Links:
Relates
relates to MGNLUI-2482 Allow setting Vaadin production mode ... Closed
causality
is causing MAGNOLIA-5240 Do not use EasyMock in FilterTest Closed
dependency
is depended upon by MGNLUI-1928 Inject UIProvider in Vaadin servlet Closed
relation
is related to MAGNOLIA-2569 Components: introduce dependency inje... Closed
is related to MAGNOLIA-4972 Commands should be able to use @Inject Closed
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 !

Generated at Mon Feb 12 03:55:23 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.