Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SOLVED: how to set locale in Filter struts 2

 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I want to set Locale in a filter but it's now woking using struts 2.
I can not go thru the class org.apache.struts because I don't have it. Must use struts 2.
[ May 23, 2007: Message edited by: Mathias Nilsson ]
 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I managed to solve this myself!
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's great that you solved the problem, but for the benefit of others who might be seeking an answer to the same problem, could you please post your solution?

Thanks
 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry... working around the clock



I'm doing this in a filter. You can use ActionContext.getContext() to set the locale at least if you are using struts 2. When choosing the resource use LocalizedTextUtil to add the resource.

I couldn't get it to work without setting the default locale.

// Mathias
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic