This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to write customized Tag handler in Struts 2

 
xsunil kumar
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have below requirment.

I have two message resource properties file. for Example. - ApplicationResources.properties and ApplicationResources-Extn.properties. I have some key values in both files but both are different. ApplicationResources-Extn.properties is used for customization of message. My requirment is that when ever i use for example <fmt:message key="mainMenu.title" />, First it has to look in to ApplicationResources-Extn.properties to get the values. If it not found there, then it will go and do lookup in ApplicationResources.properties file and return back the value.

Please suggest how i can do this.

Regards,
Sunil
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you need two resource bundles, what will happen if you are having all the values in a single file.
 
xsunil kumar
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one resource file for product. Second resource file may contain same key or may not. Second one will be used for customization. If I want to customize for one customer, then i will change value in second file. If customization is not required, then it will pick from first resource file.

So in one way i am avoiding duplication of properties file and want to achieve customization also.

Do you have any idea. I need to consider localization also.

Regards,
Sunil
 
xsunil kumar
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got some idea how to write such type of code. I have downloaded source code for tag lib and customized my class to get the desired result.

Regards,
Sunil
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post your idea
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic