In Spring MVC is it possible to access spring properties file directly from the view
I have a properties file contain a few values. I can inject tho开发者_如何学编程se values into a controller with @Value then pass the value into a view.
My question is how do I access the properties value without the controller? let's say if I want to use a tag and access the properties values within the tag thus I don't have the controller to pass down the value.
One way to do it which comes to my mind is use spring:message
It probably should work but looks like a hack and I don't recommend it.
yeah, the sprng:message serve the purpose of localization, not configuring application logic
精彩评论