16.4. Using i18n within DbForms

Instead of 'hard coding' messages, labels, etc., dbForms has made available the 'message' tag. This tag can be used to display data retrieved via a resource bundle. The actual properties file used to retrieve the text is dependant on the end-user's locale-setting.

    <%@ taglib uri="/WEB-INF/dbforms.tld" prefix="db" %>
    
        <! - - Retrieving a message  - - >
        
        
      <db:message key="msg.bienvenue.1"/>
    
        <BR><BR>
    
        <center>
      <db:message key="msg.bienvenue.2"/></center>
    
        <BR><BR>
    
    

Another feature supported, is the ability to have dbForm button tags display language-specific captions. This is achieved by setting the 'captionResource' attribute (in the dbform tag) to true. When this feature is turned on, text in the caption attribute (in a button tag) is recognized as a key and is used to lookup text in the appropriate resource bundle. If the key cannot be found, the caption value is displayed as is.

    <%@ taglib uri="/WEB-INF/dbforms.tld" prefix="db" %>
    <! - - Lookup caption in associated resource bundle - - >
    
        <db:form  tableName="myTable" 
      captionResource="true" >
    
            <db:gotoButton caption="
      button.login" destination="/login.jsp" />
            
            <db:gotoButton caption="
      button.logout" destination="/logout.jsp" />

        </db:form>