• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

What is the best approach for Messagesource?

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm building a new web app using Spring MVC 4 (under Tomcat) and I need to know what is the best approach to store the message source in my webapp.
Actually, I'm thinking to use the Spring properties file to manage all labels but I have some questions to ask: if I add a new message in my properties file, do I need to redeploy my webapp on Tomcat (stop server -> deploy -> run server)?
The second question is this: could be the database driven resource the best approach for this? In this case, i could avoid to redeploy the webapp on Tomcat (because my message resources are managed in my database)...

Thank you!!
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roberto Tucci wrote:Actually, I'm thinking to use the Spring properties file to manage all labels but I have some questions to ask: if I add a new message in my properties file, do I need to redeploy my webapp on Tomcat (stop server -> deploy -> run server)?



You should use Spring resource bundle configuration to read your messages.

If your properties file is inside your WAR, updating it will need redeploying.


Roberto Tucci wrote:
The second question is this: could be the database driven resource the best approach for this? In this case, i could avoid to redeploy the webapp on Tomcat (because my message resources are managed in my database)...



True putting such labels in DB will avoid redeploying. However, think about how you will access these messages since fetching every time is not a good idea.
 
Roberto Tucci
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

K. Tsang wrote:

Roberto Tucci wrote:Actually, I'm thinking to use the Spring properties file to manage all labels but I have some questions to ask: if I add a new message in my properties file, do I need to redeploy my webapp on Tomcat (stop server -> deploy -> run server)?



You should use Spring resource bundle configuration to read your messages.

If your properties file is inside your WAR, updating it will need redeploying.


Roberto Tucci wrote:
The second question is this: could be the database driven resource the best approach for this? In this case, i could avoid to redeploy the webapp on Tomcat (because my message resources are managed in my database)...



True putting such labels in DB will avoid redeploying. However, think about how you will access these messages since fetching every time is not a good idea.



Thanks!

I'm thinking to store a static object with all labels from DB (loaded on first deploy and available always without access on db every time)...could be a good idea? the application should be deployed anyway when i change a label on db...it's right?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic