Struts and Resource Bundle problems

admin 1
0 0
Read Time:36 Second

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!

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

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

In 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. […]
%d bloggers like this: