MessageSource « Java EE « Spring Q&A





1. Is it safe to assume that Spring MessageSource implementations are thread-safe?    stackoverflow.com

Is it safe to assume that all implementations of org.springframework.context.MessageSource interface are thread-safe after initialization? I would expect that it's safe, but now I'm looking through Spring source code, and there's org.springframework.context.support.ReloadableResourceBundleMessageSource ...

2. How to inject MessageSource to a View extending AbstractView    stackoverflow.com

I have a view class that extends AbstractExcelView

public class ExportExcelParticipantsView extends AbstractExcelView  {
...
}
I would like to inject a MessageSource to this bean. Is this possible? I use a ResourceBundleViewResolver to resolve ...

3. How can I read contents from Spring Messagesource within a Enum?    stackoverflow.com

I have an Enum containing three different Status types. These statuses should be displayed in an email sent to users, and the strings containing the statuses to be displayed are stored ...

4. Does Spring MessageSource Support Multiple Class Path?    stackoverflow.com

I am designing a plugin system for our web based application using Spring framework. Plugins are jars on classpath. So I am able to get sources such as jsp, see below

ResourcePatternResolver ...

5. Spring @Autowired messageSource working in Controller but not in other classes?    stackoverflow.com

New updates: Dec 31 2010 8:15 PM
Very dirty fix but this is how I have temporarily made the messageSource to work. I changed my Controller class to pass the 'messageSource' to Message ...

6. Issue getting Spring PropertyPlaceholderConfigurer to override MessageSource values    stackoverflow.com

I have spring Java config object that loads my properties but does not override the MessageSource tokens.

@Configuration
@SuppressWarnings("unused")
public class PropertyConfiguration {

public static final String PROPERTY_OVERRIDE_URL = "d2.config.location";

@Bean
public UrlResource propertyOverrideUrl() {
   ...

7. Moving messageSource to applicationContext causes the default messageSource not to be visible in dispatcher-servlet context    stackoverflow.com

I have a webapp in which I define the basic dispatcher-servlet context in web.xml and it loads the applicationContext. I had messageSource defined in dispatcher-servlet and was injecting it to controllers fine. I ...

8. MessageSource is not being injected by Spring    stackoverflow.com

I'm having an issue using MessageSource and Spring. For some unknown (for me, at least) reason, my messageSource object is not being instantiated. I have the following components: applicationContext.xml

...
<import resource="messageSource-ctx.xml" />
...
<context:component-scan base-package="com.foo.bar" />
... ...

9. What is wrong with my Spring MessageSource setup?    stackoverflow.com

I'm attempting to set up a ReloadableResourceBundleMessageSource to use in my JSPs and Controller. Here's the pieces I have. The message key is printing to the screen in my ...





10. Why Spring MessageSource arguments are not filled correctly in some locales?    stackoverflow.com

mailconfirm.mail.body=<html><body><h3 style="margin: 0 0 1em;">Hi, {0}!</h3>\
    To confirm your email address in Habia World, click on the confirmation link given bellow. If clicking on the link doesn't work, ...

11. Spring MVC messageSource spanish characters    stackoverflow.com

I have a portlet that uses spring mvc and when the portal is in spanish and in the controller I try to use the messageSource.getMessage it returns latin characters as weird ...

12. ResourceBundle not found for MessageSource    stackoverflow.com

I'm not able to locate the message source in my app. I have set the following configuration

<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
    <property name="basenames">
        ...

13. Problem reading Regular Expressions using MessageSource    forum.springsource.org

Problem reading Regular Expressions using MessageSource I am having difficulty reading regular expressions from a properties file using org.springframework.context.support.ResourceBundle MessageSource. The problem arises when the MessageSource interprets parts of the regex ...

14. programatically looking up a i18n value from messageSource    forum.springsource.org

Is there a way to programatically lookup an i18n key from a configured messageSource? I'm working with some tags that are not EL aware and I need to pass in a ...

15. MessageSource and args    forum.springsource.org

I'm having a problem with some simple code that uses values in a properties file. This is from a web service that was recently moved from Metro to CXF. It's also ...

16. Jstl fmt MessageFormat MessageSource (strange)    forum.springsource.org

Code: messages Code: messages.properties nowkey = hello {0, date, yyyyMM} and the result always be "hello ...





17. Are MessageSource beans supposed to be Singletons?    forum.springsource.org

Are MessageSource beans supposed to be Singletons? Hi, I'm looking at the different implementations of MessageSource (ex: ResourceBundleMessageSource and ReloadableResourceBundleMessageSource) and I notice that things are coded to allow for concurrent ...

18. Getting locale in MessageSource that extend ApplicationContextAware.    forum.springsource.org

Hi All, I have a class that implements applicationcontextaware that used to override the messageResource.getMessage feature. However now i have problem on getting the locale from the http://localhost:8080/test?lang=en. I have tried ...

19. Getting locale in MessageSource that extend ApplicationContextAware    forum.springsource.org

Hi All, I have a class that implements applicationcontextaware that used to override the messageResource.getMessage feature. However now i have problem on getting the locale from the http://localhost:8080/test?lang=en to set the ...

20. MessageSource should not translate nonexistent locales    forum.springsource.org

MessageSource should not translate nonexistent locales I'm using ResourceBundleMessageSource in spring 3.0.6-RELEASE I have the following translation files in my localization directory: - locale.en - locale.en_US - locale.en_GB - locale.it - ...

21. Unable to locate MessageSource    forum.springsource.org

I've been getting this message time and time again while defining it inside the applicationContext.xml Following the countries example, i had only that bean defined inside the context, and the servlet ...

22. messageSource definition when migrating from 1.1.4 to 1.1.5    forum.springsource.org

messageSource definition when migrating from 1.1.4 to 1.1.5 I have a web application making use of springs validation package. I noticed that if I don't specify a messageSource in spring 1.1.5 ...

23. ResourceBundle [XX] not found for MessageSource: : (    forum.springsource.org

Hi ! I'm still experimenting some features of the Spring Core container and the App Context. I made a simple AWT app as a test and i wish to display with ...

24. internationalization - messageSource    forum.springsource.org

internationalization - messageSource hi! I have a webapplication where I would like to offer a dropdown menue for the user - where he can select his language -> and then all ...

25. MessageSource with external property file    forum.springsource.org

Yes, you can actually load from all kinds of resources: "basename" is a Spring resource location, following the same rules as an application context's "contextConfigLocation" etc. A plain path will be ...

26. messageSource in defined in application context loaded by dispatchservlet    forum.springsource.org

messageSource in defined in application context loaded by dispatchservlet Hello, I am using SpinrMVC+Hibernate+Tomcat. I have pretty standard applicationcontext defined in my web app. My DispatchServlet is named "action" and it ...

27. MessageSource null in Tapestry    forum.springsource.org

MessageSource null in Tapestry hi, I use tapestry and spring together.Now I can inject many beans defined in spring into Tapestry pages,but during using MessageSource in Tapestry ,i enccounter a problem.Here ...

28. Different set the messageSource name based on request parameters    forum.springsource.org

Different set the messageSource name based on request parameters Hey everyone any help or direction would be greatly appreciated. I am new to the spring framework and not sure if this ...

29. getKeys for MessageSource    forum.springsource.org

getKeys for MessageSource Hello, from MessageSourceResourceBundle: /** * This implementation returns null, as a MessageSource does * not allow for enumerating the defined message codes. */ public Enumeration getKeys() { return ...

30. how to work with messageSource    forum.springsource.org

I have declared the bean messageSource of ResourceBundleMessageSource. plz let me know how to access from different properties files of different locales in my own bean. (i.e. not jsp pages); all ...

31. Using the Form-Taglib with MessageSource to display an enum    forum.springsource.org

Using the Form-Taglib with MessageSource to display an enum Hi, I'd like to do something like this: Code: "/> But it doesn't work: /WEB-INF/jsp/test.jsp(55,83) equal symbol expected Any ...

32. Cannot inject messageSource to custom error handling class    forum.springsource.org

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 ...

33. messageSource locale selection and basename    forum.springsource.org

messageSource locale selection and basename I spent days to troubleshoot 2 problems related the locale specific message resolution. It seems to me that Spring only use the message resource with basename ...

34. MessageSource and Errors argument    forum.springsource.org

MessageSource and Errors argument I struggle with translating messages via the MessageSource and I cannot figure out how to use the "argument" feature. I create an Errors by Code: errors.rejectValue(lastname, "error.between", ...

35. Getting MessageSource with ClassPathXmlApplicationContext    forum.springsource.org

org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [aplicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [aplicationContext.xml] cannot be opened because it does not exist Caused by: java.io.FileNotFoundException: class path ...

36. Unable to locate MessageSource    forum.springsource.org

Unable to locate MessageSource I implemented: messages in serviceimport-servlet.xml (see below) but when running my application I receive the following message in my ...

37. messageSource problem    forum.springsource.org

38. can we have multiple messageSource spread across many configuration files    forum.springsource.org

Hi All, I have a wish list here, 1. Can messageSource (ReloadableResourceBundleMessageSource) load all the files from a directory recursively or 2. can messageSource bean be defined multiple times spread across ...

39. Parameterizing MessageSource    forum.springsource.org

Parameterizing MessageSource I need to define a MessageSource whose baseName needs to be parameterized using a propertyConfigurer. I would like to know how I can parameterize a list of baseNames (hypothetically) ...

40. Augmenting basenames to messageSource    forum.springsource.org

Augmenting basenames to messageSource I have a webapp that is comprises components (jarfiles) which are developed by distinct teams concurrently and integrated into the webapp. Each component (jarfile) contributes its own ...

41. Cannot resolve codes from messageSource    forum.springsource.org

Cannot resolve codes from messageSource I have a simple messageSource with two basenames defined as shown below. Code: classpath:messages/Test1MessageDictionary classpath:messages/Test2MessageDictionary ...

42. "MessageSource is required" error while using a custom ViewResolver    forum.springsource.org

"MessageSource is required" error while using a custom ViewResolver Hi, I need to define a custom ViewResolver since I have dozens of views which map viewName either to a JSTLView or ...

43. ResourceBunde not found for MessageSource    forum.springsource.org

ResourceBunde not found for MessageSource Good afternoon, I am getting the following error when I start up my application. 2007-09-04 17:34:03,374 WARN org.springframework.context.support.ResourceBundle MessageSource getResourceBundle - ResourceBundle [/WEB-INF/properties/messages.properties] not found for ...

44. thread-safety in MessageSource bean    forum.springsource.org

thread-safety in MessageSource bean Hi guys, I am trying to create a subclass of MessageSource, say DbBundleMessageSource that access the database for resource bundle. (e.g. like ReloadableResourceBundleMessageSource.java except it uses DB ...

45. Where to define messageSource bean?    forum.springsource.org

Where to define messageSource bean? Hi, where is the correct place to define messageSource bean? In the "application context" config files or in the "servlet context" config files? I'm demanding this ...

46. messageSource only support ISO-8859-1 ?!    forum.springsource.org

messageSource only support ISO-8859-1 ?! Hi, I use jsp tag in my form like this, Code: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

47. Acccessing the MessageSource in stand alone application    forum.springsource.org

HI, I want to know how to use/catch the messageSource(Resource Bundle) configured in applicationContext.xml in normal class using dependency injection. Regards, Guru

48. MessageSource Problem.    forum.springsource.org

MessageSource Problem. I specifed my resource files in applicationContext.xml as follows messages (i placed messages.properties under WEB-INF/classes) I am reading in my class ...

49. MessageSource Problem    forum.springsource.org

MessageSource Problem I configured the messageSource object in my .xml file as messages (Actually messages.properites files are under classes folder.) IN my class ...

50. MessageSource Problem    forum.springsource.org

I am using messageSource object thru DI in my class.It is not able to lookup into the messages. I configured all the things properly and i kept the property that i ...

51. MessageSource basename that points to utilityJar?!?    forum.springsource.org

MessageSource basename that points to utilityJar?!? So, This is driving me nuts, anybody have any idea how to specify the basename of a ReloadableResourceBundleMessageSource to find a *.properties file that resides ...

53. Loading MessageSource in library    forum.springsource.org

Loading MessageSource in library I'm working on two projects, one webapp and one (jar)library which the webapp depends on. For the webapp I already have one class named SB that has ...

54. MessageSource    forum.springsource.org

Hi, Is it possible to use the following in the properties file for messageSource. sentence=My name is ${name} name=Bob The return value of messageSource.getMessage("sentence", null, null) would be: My name is ...

55. Abstract Class and MessageSource    forum.springsource.org

Hi, I wanted to have an abstract controller that my other controllers extended, just to set up service objects and logging and such. My service objects are autowired fine and logging ...

56. Unable to locate MessageSource with name 'messageSource':    forum.springsource.org

Unable to locate MessageSource with name 'messageSource': Hai all, I got an "Unable to locate MessageSource with name 'messageSource':" while running my application. The ApplicationContext.xml is Code:

57. messageSource inside a jar - how to link to it?    forum.springsource.org

messageSource inside a jar - how to link to it? Hello, I am developing an app, making intensive use of a jar file produced by another group at my company. The ...

58. MessageSource Configuration Troubleshooting    forum.springsource.org

MessageSource Configuration Troubleshooting Hi, I'm trying to retrieve messages using the WebApplicationContext and the ReloadableResourceBundleMessageSource. My ReloadableResourceBundleMessageSource configuration looks like this: com.example.messages ...

60. Can't set 'basenames' property in messageSource bean    forum.springsource.org

61. Alternative messageSource    forum.springsource.org

Hi all, I've get stuck trying to setup two different-type message sources to my application based on Spring 2. This is the contents of servlet.xml: Code:

62. Arguments in MessageSource are not resolved    forum.springsource.org

Arguments in MessageSource are not resolved I think this is trivial, but still I could not find a solution. We are using this messageSource:

63. Error in Unable to locate MessageSource with name 'messageSource', ThemeSource    forum.springsource.org

Feb 18th, 2009, 10:02 PM #1 vitalstrike82 View Profile View Forum Posts Private Message Junior Member Join Date Feb 2009 Posts 12 Error in Unable to locate MessageSource with name 'messageSource', ...

64. Question related to messageSource    forum.springsource.org

Question related to messageSource Hi, This question is just partly related to Roo. I'm using Roo as "best-practice-template" for a Spring app. I also used the messageSource definition in the springmvc-config.xml.. ...

65. MessageSource from network resource?    forum.springsource.org

Come on, there has to be an easy way :-) Would like to have a MessageSource (ReloadableResourceBundleMessageSource if possible) that can load a messages properties from the network (http) However, this ...

66. MessageSource default Locale    forum.springsource.org

MessageSource default Locale hello i'm using spring for a desktop application. each component that should print string literals to the screen is injected with a MessageSource, by which it queries the ...

67. Validator messageSource help    forum.springsource.org

Validator messageSource help Version: Spring 2.5.6 Hello. I am new to Spring (and I haven't used Java in a while), and I have inherited an Spring application that I need to ...

68. MessageSource properties file loading from a remote location    forum.springsource.org

MessageSource properties file loading from a remote location Hi All, I am using Spring web-mvc in SAP web server. Is it possible to store the properties file in some remote location ...

69. Using MessageSource to get properties    forum.springsource.org

If I have a properties file in the following format: test1.properties test_var_1=10 test_var_2=20 Can't MessageSource be used to retrieve the values? MessageSource ...

70. Freemarker - messageSource    forum.springsource.org

71. Custom MessageSource. Arguments are not resolved    forum.springsource.org

Custom MessageSource. Arguments are not resolved Hi guys, I'm stuck on a strange thing. When the system is using "en" language everything works ok. When I switched language to e.g. "fr" ...

72. MessageSource for Configuration properties - Best Practise?    forum.springsource.org

MessageSource for Configuration properties - Best Practise? Hi Im working on a multi-war application and we have some configuration in property files eg. paths to resources such as other property files, ...

73. Use a MessageSource for Configuration Properties??    forum.springsource.org

I have a number of property files in an application and Im planning to use a MessageSource to retrieve them in my application. Can anyone see any problems with using a ...

74. getBean() returns DelegatingMessageSource instead of my MessageSource implementation    forum.springsource.org

getBean() returns DelegatingMessageSource instead of my MessageSource implementation Java 1.6 Tomcat 6 Spring 3.0.0 I've implemented my own database driven MessageSource and everything is working perfectly, until I need to refresh ...