Struts and Resource Bundle problems

1

Working my way through the first chapter of Jakarta Struts Live book, I could not get my own application working, failing at the


<bean:message key="welcome.databaseSelection"/>

The annoying thing was that the JSP page containing this statement remained blank! Inspection in the Tomcat log files showed that there was a problem with the resource bundle:

Cannot find message resources under key org.apache.struts.action.MESSAGE

On the Internet I found that I had to add

<message-resources parameter= "resources/application" />

to the struts-config.xml (right after the action-mapping section!), where my resource bundle resides in

WEB-INF/classes/resources/application.properties

I could not find any mention of this in the book though!

Share.

About Author

1 Comment

  1. it also works by creating a file called ApplicationResources.properties in your WEB-INF/classes dir, and adding

    <initparam>
    <paramname>application</paramname>
    <paramvalue>ApplicationResources</paramvalue>
    </initparam>
    

    as a parameter to the actionservlet-declaration in web.xml
    (hmm add a ‘-’ before or after ‘param’, the wordpress thingy doesn’t like it if i use it)