mwaschkowski
Mar 20th, 2005, 09:50 AM
Hey Everyone!
First off, I want to say thanks to the people that wrote up the spring online docs and the MVC-step-by-step tutorial. They did a good job that didn't cost me anything, and deserve respect for that.
This morning I had some problems with being able to use the springMessage velocity tag with a MessageResource bundle. A couple of things to note:
1) On the page below, it shows the ResourceBundleMessageSource in the springapp/war/WEB-INF/springapp-servlet.xml:
http://www.springframework.org/docs/MVC-step-by-step/Spring-MVC-step-by-step-Part-2.html
2) One this page (13.4.5.3. form input generation macros), it shows using the message bundle like this: #springMessage($code)
http://www.springframework.org/docs/reference/view.html
For me, putting the ResourceBundleMessageSource in the servlet.xml file DID NOT WORK. Only after I carefully checked the logs did I find out that no ResourceBundleMessageSource was being loaded, after quite some time I might add :( Then, it still didn't work on the page. I had to use the following format:
#springMessage("userAdmin.firstName")
I like Spring alot. It gives a lot. But, docs are still very limited, and now that I've wasted a couple of hours trying to configure it, and its frustrating.
Suggestions, meant in the most constructive manner:
1) Put the ResourceBundleMessageSource in the applicationContext.xml
2) Update the velocity page are take out the $ except where required for velocity, confusing otherwise.
Best regards,
Mark
First off, I want to say thanks to the people that wrote up the spring online docs and the MVC-step-by-step tutorial. They did a good job that didn't cost me anything, and deserve respect for that.
This morning I had some problems with being able to use the springMessage velocity tag with a MessageResource bundle. A couple of things to note:
1) On the page below, it shows the ResourceBundleMessageSource in the springapp/war/WEB-INF/springapp-servlet.xml:
http://www.springframework.org/docs/MVC-step-by-step/Spring-MVC-step-by-step-Part-2.html
2) One this page (13.4.5.3. form input generation macros), it shows using the message bundle like this: #springMessage($code)
http://www.springframework.org/docs/reference/view.html
For me, putting the ResourceBundleMessageSource in the servlet.xml file DID NOT WORK. Only after I carefully checked the logs did I find out that no ResourceBundleMessageSource was being loaded, after quite some time I might add :( Then, it still didn't work on the page. I had to use the following format:
#springMessage("userAdmin.firstName")
I like Spring alot. It gives a lot. But, docs are still very limited, and now that I've wasted a couple of hours trying to configure it, and its frustrating.
Suggestions, meant in the most constructive manner:
1) Put the ResourceBundleMessageSource in the applicationContext.xml
2) Update the velocity page are take out the $ except where required for velocity, confusing otherwise.
Best regards,
Mark