>Hi,
>     Is it possible or feasible to have differenet application
> properties file for each module in my web app.

Here is how I do it.

This is usually an initialization Servlet
    /**
     * Initialize our internal MessageResources bundle.
     *
     * @exception ServletException if we cannot initialize these
resources
     */
    protected void initMessages() throws ServletException {

        try {
            catalogMessages =
MessageResources.getMessageResources(catalogMessagesName);
            getServletContext().setAttribute(Constants.MESSAGES_KEY,
catalogMessages);
        } catch (MissingResourceException e) {
            String message = "Cannot load catalog resources from '" +
catalogMessagesName + "'";
            log(message,e);
            throw new ServletException(message);
        }
    }

Then in the JSP's that use that message bundle:

   <bean:message bundle="<%= Constants.MESSAGES_KEY %>"
key="button.catalog.delete.catalog"/>
or
   <html:errors  bundle="<%= Constants.MESSAGES_KEY %>"
property="helpPath"/>

The Action classes are used as usual for error messages going back to
input pages:
                errors.add(ActionErrors.GLOBAL_ERROR, new
ActionError("error.catalog.query"));
For pages w/o Input pages then you lookup the message before throwing an
exception
or logging it to a file.

  catalogMessages.getMessage("ok.catalog.connection")


-- 
Robert Leland ([EMAIL PROTECTED])
804 N. Kenmore Street
Arlington, VA 22201-2225
Voice: 703-525-3580

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to