on 08-10-2007 5:31 AM
Hi Friends,
I had developed one web dynpro application by using Internationalization - I18N of WebDynPro (Java) Application (Blog) but I got one error that is
<b>java.util.MissingResourceException: Can't find bundle for base name com.sap.example.language.lang, locale en_US</b> Actually i created two properties file
1. lang_en.properties
2. lang_ta.properties
I stored this two properties file in this package com.sap.example.language
and this my code in DOInit()
sessionLocale = WDClientUser.getCurrentUser().getLocale();
resourceHandler = ResourceBundle.getBundle("com.sap.example.language.lang",sessionLocale);
}
catch (WDUMException e)
{
e.printStackTrace();
}
wdContext.currentContextElement().setUsername_label(resourceHandler.getString("testview.username"));
wdContext.currentContextElement().setPassword_label(resourceHandler.getString("testview.password"));
How to solve this error?
Guide me.
Advance Thanks,
Balaji
1. Place your lang_en.properties, lang_ta.properties in dist/PORTAL-INF/classes
2. In PORTALAPP.XML add this property to your Component config:
<property name="ResourceBundleName" value="lang"/>
3. In your message class use this modified method to get resources:
public static String getString(IPortalComponentRequest request, String key) {
try {
return request.getResourceBundle().getString(key);
} catch (MissingResourceException e) {
return key;
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.