Using ResourceBundles (without having to restart container)

From OpenCms Wiki
Revision as of 19:46, 5 March 2007 by Marc.johnen (Talk | contribs)
Jump to: navigation, search

taken from the newsgroup:

It's a pain to work with i18n'ed jsp pages, and restart the container every time I want to see if the keys are working ok.

Actually there is a feature in OpenCms 6.2 for this:

All OpenCms module based message bundles are flushed if you clear the cache, which can be triggered by "Administration View > Workplace Tools > Re-Initialize the Workplace".

You can also use this caching behaviour in your Java code like this:

org.opencms.i18n.CmsResourceBundleLoader.getBundle(baseName, locale);

which is the same as

java.util.resourceBundle.getBundle(baseName, locale);

only that we do have the flushable bundle cache.

You should put the property-files into your module's classes folder in opencms.
COMMENT: This didn't work for me, but it works putting it in "/tomcat/webapps/opencms/WEB-INF/classes".

Example:

Invalid language.

You need to specify a language like this: <source lang="html">...</source>

Supported languages for syntax highlighting:

actionscript, ada, apache, applescript, asm, asp, autoit, bash, blitzbasic, bnf, c, c_mac, caddcl, cadlisp, cfdg, cfm, cpp, cpp-qt, csharp, css, d, delphi, diff, div, dos, eiffel, fortran, freebasic, gml, groovy, html4strict, idl, ini, inno, io, java, java5, javascript, latex, lisp, lua, matlab, mirc, mpasm, mysql, nsis, objc, ocaml, ocaml-brief, oobas, oracle8, pascal, perl, php, php-brief, plsql, python, qbasic, reg, robots, ruby, sas, scheme, sdlbasic, smalltalk, smarty, sql, tcl, text, thinbasic, tsql, vb, vbnet, vhdl, visualfoxpro, winbatch, xml, z80

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox