I have a view class that extends AbstractExcelView
public class ExportExcelParticipantsView extends AbstractExcelView {
...
}
I would like to inject a MessageSource to this bean. Is this possible?
I use a ResourceBundleViewResolver to resolve views (in this case)
<bean id="resourceBundleViewResolver"
class="org.springframework.web.servlet.view.ResourceBundleViewResolver">
<!-- Classpath needs to have views.properties -->
<property name="basename" value="views" />
<!-- This view resolver is the first one used -->
<property name="order" value="0"/>
<property name="defaultParentView" value="parent-view"/>
</bean>
Is it so that this view class is instantiated each time the view is requested and thus injecting a message source to this class is harder than usual? Is it even possible?
At the moment I pass the MessageSource as a model attribute from the controller to the view. Is it possible to avoid this?