Announcement Announcement Module
Collapse
No announcement yet.
Cannot inject messageSource to custom error handling class Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot inject messageSource to custom error handling class

    Good evening,

    I am trying to use message source in order to create some errors for my application, apart from the Errors available from Spring. I am trying to inject the application messageSource via the following, in myapp-servlet.xml file

    Code:
        <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
            <property name="basename">
                <value>MessageResources</value>
            </property>
        </bean>
            
    	  <bean id="reqxErrors" class="org.reqx.web.validation.ReqxErrors">
    		<property name="messageSource" ref="messageSource"/>
    	</bean>
    But I get a NPE when I tr yto access the messageSource from my ReqxErrors class. Do I have to go via the ServletContext route ...

    Thanks for your help!
Working...
X