Properties File

uitags comes bundled with a set of default configuration values, called "factory default" settings. You can override these values, and therefore alter uitags' default behavior, by placing uitags/site-wide.properties in your WEB-INF/classes directory.

        WEB-INF/
           |
           +--- classes/
                   |
                   +--- uitags/
                          |
                          +--- site-wide.properties
      

Use the factory-default properties file as a template for your site-wide properties file. It is very important that your webapp has its own JavaScript file (you can copy one from uitags demo/sample application) and its location is specified by the common.js.url property in site-wide.properties.

Another way to control uitags' behavior is by setting values through tag attributes. Many tag attributes have a corresponding entry in the site-wide properties file. If you expect certain configuration values to be used consistently throughout the whole webapp, put them in the site-wide properties file rather than specify them each time you use a tag.

Internationalization (I18N)

Webapps usually rely on tools such as Struts or JSTL for internationalization. uitags can be configured to work with such framework when retrieving messages, freeing you from having to create separate resource bundle(s) for uitags.

By the default uitags ignores i18n, it displays strings (provided by tag attributes or in properties files) as is. To enable i18n, simply nominate the adapter that understands how to interface with your i18n framework. For example, the following line in site-wide.properties tells uitags to use Struts i18n framework:

          common.message.finder=net.sf.uitags.tagutil.StrutsMessageFinder
        

You can provide your own message finder, it just has to implement the net.sf.uitags.MessageFinder interface. Note: at the moment Struts and JSTL message finders are the only adapters provided by uitags. We'd appreciate help in writing adapters for other frameworks such as Spring, WebWork, etc.

After enabling i18n, you should ensure that you always pass message keys to uitags rather than the actual strings to be displayed.