• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Multiple locale /en/home/index.action mapping with struts2

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
for internationalization needs in a SEO content manager software developed with struts2 and running on JBoss 5, I need to map the same package/namespace multiple times, for every language. I'd like to get a way to make different locale pages have permanent links, opposed to the struts2 way in which locale is binded in the session. Example:

The scenario is (suppose index.action is the home page/action):
http://www.myhost.com/en/portal/index.action
http://www.myhost.com/fr/portal/index.action
http://www.myhost.com/es/portal/index.action

I'd like the /portal package (group of struts2 actions) to be mapped not just like /portal but /en/portal, es/portal, ...
index.action must invoke the same action as content returned will be the same (exception localization, of course). I've developed an interceptor that sets locale based on that first "/en" part in the request path.

Of course I can always do:



But that means repeating the same mappings for every package.

Any idea on how to achieve this in a simpler way?

Thanks for any help/directions,
Ignacio
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic