Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Overwritting message-resources

Brian M Smith
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm faced with a problem that I'm not sure how to get around. I'm hoping that I can accomplish this with struts and not have to write any additional Java code.

Problem: I need to render different messages in a JSP from properties files based on struts module.

Example: http://localhost:8080/mod1/ and http://localhost:8080/mod2/ load the same JSP after performing some actions.

The JSP has a properties key in it

There are 2 struts config files defined in web.xml mod1_config.xml and mod2_config.xml which are mapped to the mod1 and mod2 struts modules.

mod1_config.xml contains a message-resource entry mapping to
mod2_config.xml contains a message-resource entry mapping to contains an entry mod1 contains an entry default.

Now what I would expect to happen is when I visit http://localhost:8080/mod1/ I should see the text "Product mod1" and when I visit http://localhost:8080/mod2/ I should see "Product default". The problem is that no matter which URL/struts module I use I always end up seeing "Product default".

Is this behavior something that struts should support without customization?

Thanks in advance!


  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic