-
1. Re: problem with custom localeselector
scphantm.scphantm.gmail.com Feb 18, 2010 8:01 PM (in response to scphantm.scphantm.gmail.com)sorry, this is the line above the logger.warn
super.selectLanguage(language);
-
2. Re: problem with custom localeselector
scphantm.scphantm.gmail.com Feb 19, 2010 6:04 PM (in response to scphantm.scphantm.gmail.com)any ideas on this? this issue is holding up a rollout to testing, im stumped.
-
3. Re: problem with custom localeselector
thokuest Feb 19, 2010 8:19 PM (in response to scphantm.scphantm.gmail.com)What about the other beans? How do they use the locale? Maybe it's better to post some code.
-
4. Re: problem with custom localeselector
scphantm.scphantm.gmail.com Feb 19, 2010 8:31 PM (in response to scphantm.scphantm.gmail.com)import java.util.Locale; @In private Locale locale; function blka returnValue = localButtonRoot + locale.getLanguage() + "/" + showFile; return returnValue;
thats all im trying to do, pretty rudimentary but i can't get it to work. i don't get it. when i use
#{localselector.selectlanguage('es')}
on a command button the the above code works perfectly. but i need to dump my cache fragments before i switch locals so the urls to all my language sensitive buttons are updated correctly.
-
5. Re: problem with custom localeselector
thokuest Feb 20, 2010 7:46 PM (in response to scphantm.scphantm.gmail.com)You could try to bandy Seams localeSelector with your custom implementation. This should work:
import static org.jboss.seam.annotations.Install.APPLICATION; import org.jboss.seam.ScopeType; import org.jboss.seam.annotations.In; import org.jboss.seam.annotations.Install; import org.jboss.seam.annotations.Logger; import org.jboss.seam.annotations.Name; import org.jboss.seam.annotations.Scope; import org.jboss.seam.annotations.intercept.BypassInterceptors; import org.jboss.seam.cache.CacheProvider; import org.jboss.seam.international.LocaleSelector; import org.jboss.seam.log.Log; @Scope(ScopeType.SESSION) @Name("org.jboss.seam.international.localeSelector") @BypassInterceptors @Install(precedence=APPLICATION, classDependencies="javax.faces.context.FacesContext") public class CustomLocaleSelector extends LocaleSelector { private static final long serialVersionUID = 1L; private @In CacheProvider cacheProvider; private @Logger Log logger; private void killCache() { try { logger.debug("trying to kill the cache"); cacheProvider.remove("cssfragment", "languagebuttons"); logger.debug("killed the cache"); } catch (Exception ex) { logger.debug("kill cache died"); ex.printStackTrace(); } } @Override public void select() { killCache(); super.select(); logger.warn(super.getLanguage()); } }
You can use this custom localeSelector as usual.
-
6. Re: problem with custom localeselector
scphantm.scphantm.gmail.com Feb 23, 2010 5:52 PM (in response to scphantm.scphantm.gmail.com)remove the bypassintercepters and worked perfectly. thanks a lot, i didn't realize i can overload base seam components like that. wish i knew that when i was building my authentication system.