Struts and Resource Bundle problems

admin 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!

One thought on “Struts and Resource Bundle problems

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

    
    application
    ApplicationResources
    
    

    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)

Comments are closed.

Next Post

Useful Eclipse-related links

Facebook0TwitterLinkedinIn Nancy Chen Junhua’s article on Developing Struts with Easy Struts for Eclipse she has some interesting pointers to documents on “Eclipse Aided Development” on IBM’s developerworks. In my experience, the articles found on IBM’s developersworks are of good quality. Articles for Eclipse users in the Open source projects zone. […]