>you can always implement your own >LocalizedTextProvider and search in default bundles first and then >fallback to searching class hierarchy.
There seems alot going on in DefaultLocalizedTextProvider so I would rather stay with the default and do the local modification. >Something like getDefaultText() It would mean refractoring the code slightly, not sure what other users would want, but I remember an email a while back on the same thing, ie only using the default package of the class rather than all the interfaces etc. Maybe class package, default then scan the interfaces (nifty thing)? >Maybe I should prepare a small demo? Maybe give us an idea of how to use the bean. Cheers Greg On 15 March 2017 at 08:32, Łukasz Lenart <[email protected]> wrote: > Something like getDefaultText()? but you can always implement your own > LocalizedTextProvider and search in default bundles first and then > fallback to searching class hierarchy. > > Maybe I should prepare a small demo? > > > Regards > -- > Łukasz > > 2017-03-15 9:08 GMT+01:00 Greg Huber <[email protected]>: > >>Hm... I think defining struts.custom.i18n.resources should resolve your > > problem > >>struts.custom.i18n.resources=ApplicationResources > > > > I already have this, but since I came from a struts 1, I am not motivated > > to use the class package logic as there would be too much duplication and > > maintenance of all the .properties files. > > > > I do use package files for validation, just not the UI layer, so I still > > need to do the nifty thing (all though I do get warning messages with the > > modification doing the default first for these). > > > > The package search is just too extensive as it looks at interfaces of the > > classes etc and is too much of an overhead for busy screens. Just the > > package where the action class is should be enough? > > > > Maybe it would be useful to have a method in DefaultLocalizedTextProvider > > that only does the search/order so we could override it and implement our > > own. > > > > Cheers Greg > > > > > > > > > > On 14 March 2017 at 18:24, Lukasz Lenart <[email protected]> > wrote: > > > >> 2017-03-14 16:13 GMT+01:00 Greg Huber <[email protected]>: > >> > I replace: > >> > > >> > // search up class hierarchy > >> > String msg = findMessage(aClass, aTextName, indexedTextName, > >> > locale, args, null, valueStack); > >> > > >> > with: > >> > > >> > GetDefaultMessageReturnArg result = null; > >> > if (indexedTextName == null) { > >> > // Use a null for the defaultMessage to ensure > >> > // package check is done if not found. Will get dev > messages > >> if > >> > // not found in default packages. > >> > result = getDefaultMessage(aTextName, locale, valueStack, > >> args, > >> > null); > >> > } > >> > String msg = null; > >> > if (result == null) { > >> > // search up class hierarchy > >> > msg = findMessage(aClass, aTextName, indexedTextName, > locale, > >> > args, > >> > null, valueStack); > >> > } else { > >> > msg = result.message; > >> > } > >> > > >> > Guess I will have to continue this mod unless there is some way to > >> override > >> > the default search package nifty thing. > >> > >> Hm... I think defining struts.custom.i18n.resources should resolve your > >> problem > >> > >> struts.custom.i18n.resources=ApplicationResources > >> > >> Or you can implement your own LocalizedTextProvider and used instead > >> the one provided by the framework (when my gets merged :) Anyway I > >> think this is good to merge, we can think about improving it with > >> another PR. > >> > >> > >> Regards > >> -- > >> Łukasz > >> + 48 606 323 122 http://www.lenart.org.pl/ > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [email protected] > >> For additional commands, e-mail: [email protected] > >> > >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
