Outbound rewriting with El.property not working

Splash Forums Rewrite Users Outbound rewriting with El.property not working

This topic contains 1 reply, has 2 voices, and was last updated by  Christian Kaltepoth 7 years, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #26354


    I’m running on Rewrite 2.0.12.Final (with faces and cdi integration modules), JSF 2.2, CDI (OWB), TomEE 1.7.0.
    I have a rule:


    This rule is called during an inbound call (and property is set), yet is not called during outbound call, that is, the link:

    <h:link value="Link to index" outcome="/index.xhtml" />

    is rendered as “/index.xhtml”. I would assume that this link had to be rendered as “/lang/index”, where “lang” would be outjected from “localeBean.language”. localeBean is an CDI ApplicationScoped bean (for testing):

    import javax.enterprise.context.ApplicationScoped;
    public class LocaleBean implements Serializable {
        private String language = LANGUAGE_LT;
        // Getter and setter

    Or should I write separate rule for outbound direction?



    sorry for the very late reply. I was on vacation.

    Outjection won’t work this way. You have to make sure that JSF renders the correct query parameter value to the URL. If the query parameter is present, the rewriting will work as expected. So you will have to do something like this:

    <h:link value="Link to index" outcome="/index.xhtml">
      <f:param name="lang" value="#{localeBean.lang}" />
Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘Rewrite Users’ is closed to new topics and replies.

Comments are closed.