Reply To: SEO URL supporting l10n/i18n with //Rewrite

Splash Forums Rewrite Users SEO URL supporting l10n/i18n with //Rewrite Reply To: SEO URL supporting l10n/i18n with //Rewrite

#23602

Let me try to explain what these errors mean:

`
java.lang.IllegalArgumentException: FacesContext.getCurrentInstance() returned null. EL expressions can only be evaluated in the JSF lifecycle. You should use PhaseAction and PhaseBinding to perform an deferred operation instead.
`

This basically tells you that Rewrite tries to bind the parameter value to you bean property but isn’t able to access the FacesContext. This is caused by the fact the Rewrite performs the binding very early in request processing at a time where the JSF lifecycle hasn’t started yet. To fix this issue you have to wrap the EL binding in a `PhaseBinding` like this:

`
.where(“lang”).bindsTo(PhaseBinding.to(El.property(“localeHandler.languageSelected”)))
`

The other error:

`
javax.el.PropertyNotFoundException: ELResolver cannot handle a null base Object with identifier ‘localeHandler’
`

This one means that CDI isn’t able to find a bean named `localeHandler`. Is you bean named correctly? Is the LocaleHandler a bean managed by CDI or by JSF?