StripesFramework / stripes

Stripes is a Java framework with the goal of making Servlet/JSP based web development in Java as easy, intuitive and straight-forward as it should be. It's stripey and it doesn't suck.
http://www.stripesframework.org/
171 stars 73 forks source link

LocalizationUtility.LocalizationUtility ignores actionPath #61

Closed herrlado closed 8 years ago

herrlado commented 8 years ago

LocalizationUtility.LocalizationUtility ignores actionPath so that my old i18n keys does not any more work.

rgrashel commented 8 years ago

Can you provide a fragment of code which fails. The code has not changed in this area and I do see the actionPath being referenced from within all of the major Stripes tags which have labels.

herrlado commented 8 years ago

Here is the old version (1.4.3), line 70, usage of actionPath http://grepcode.com/file/repo1.maven.org/maven2/net.sourceforge.stripes/stripes/1.4.3/net/sourceforge/stripes/localization/LocalizationUtility.java

Now check the master of stripes

https://github.com/StripesFramework/stripes/blob/master/stripes/src/main/java/net/sourceforge/stripes/localization/LocalizationUtility.java

actionPath argument is not being used.

rgrashel commented 8 years ago

Ok, I've looked in the history and this was removed several years ago (but the argument was left there by accident). It was deprecated in v1.5 and then removed shortly after that. The argument should have been removed also.

https://github.com/StripesFramework/stripes/commit/e58c12896864aaf57e8d1dd1a15b8a9bbc18c66b

The Stripes tags definitely do not use action paths anymore. They use the simple name of the action bean now instead of the action path. I don't see a good history on why the action path was deprecated in favor of the action bean class name, but there must have been a problem with that approach.

So I see that you probably only have two options: 1) Converting your existing i18n keys and do a search and replace for actionPath => action bean class name. Which may involve modifying any custom code you have which calls LocalizationUtility, or 2) Use a custom version of LocalizationUtility (which resolves using the actionPath) and put that in your project. You would need to make sure that the logic for the action bean class stays in there though, otherwise Stripes tags from 1.5.x and forward will not work.

herrlado commented 8 years ago

Everything is fine. I have converted the I18N keys. Thanks!