get key from Resource Boundle without exception when missing

R

ridvansg

Hi everyone,
I am trying to retrieve resource from resource bundle with a code:
ResourceBundle
rb=PropertyResourceBundle.getBundle("MessageResources",m_locale);
rb.getString("field.text");

the probblem is that the code rb.getString("field.text") throws
exception

my resourse bundle is configured as <message-resources
parameter="MessageResources" null="false" /> in struts-config.xml

and

<context-param>


<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>

<param-value>MessageResources</param-value>

</context-param>

in web.xml in order for jstl fmt:message to run.

I will appriciate any help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top