In order to define my beans using Spring DSL, I have moved my bean definitions from resources.xml to resources.groovy. After doing so my beans are not automatically injected to my controllers and services. Previously, with resources.xml, without explicitly wiring the beans if I define something like
in the controllers or services code, myBeanName would be automatically injected. But this is not happening now.
Is there any other configuration or setting we have to do in addition to just moving the definitions from resources.xml to resources.groovy
The beans in .groovy are being initiated and loaded by the container, because if I make any mistake in the definition, it complains. The only thing is that the beans are not being injected to controllers.
Thanks for the reply. It is working now. Actually one of the bean which had backslashes \ was not working. I kept that one in resources.xml and moved everything else to resources.groovy.
The culprit bean looks like this
I tried to escape the backslashes with \\ but it was not working. So I left that one in .xml and moved everything else to .groovy. I found that this one is the real culprit by just hit and trial. In the logs there was nothing which points me to this.
Joined: Jul 15, 2009
Do you know that you can use / as a string delimiter? If you use that, you don't need to escape backslashes. For example:
Joined: Feb 26, 2005
I tried using / as the delimiter. But in my string I have curly braces too. These curly braces don't seem to be escaped by /