Multilanguage when migration from prettyfaces

Splash Forums Rewrite Users Multilanguage when migration from prettyfaces

This topic contains 0 replies, has 1 voice, and was last updated by  icordoba 2 years, 1 month ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #26316

    icordoba
    Participant

    Hello,
    I’m migrating from PrettyFaces configuration to new Rewrite class based.
    I’ve been reading entry http://ocpsoft.org/support/topic/handling-multilanguage-jsf-application-with-rewrite/ but can’t figure out how to port the multi language approach of my custom content manager. For example, to force home page to be spanish I currently have:

    <url-mapping id=”esHome”>
    <pattern value=”/” />
    <view-id value=”/index.xhtml”/>
    <action>#{userSessionView.setLanguage(“es”)}</action>
    </url-mapping>

    userSessionBean is a DCI session scope bean. Method setLanguage(“es”) just invokes

    FacesContext.getCurrentInstance().getViewRoot().setLocale(newLanguage);

    This won’t work with

    ConfigurationBuilder.begin().addRule(Join.path(“/”).to(“/index.xhtml”)).perform(Invoke.binding(El.retrievalMethod(“#{userSessionView.setLanguage(‘es’)}”)))

    as FacesContext.getCurrentInstance() will return null, so I get a NPE.

    Any help on how to solve this? Thanks.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

Comments are closed.