Tripping on external urls

Splash Forums Rewrite Users Tripping on external urls

This topic contains 4 replies, has 2 voices, and was last updated by  fabmars 8 years, 6 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #24339


    Now one can write an external link like <a href="">OCP</a> in a facelet whereas it had to be written via a h:outputLink before JSF2. Well, I have several “useless” outputLink’s because my code is old and got migrated from JSF 1.2.

    I noticed that when I have such an external link <h:outputLink value="">, Rewrite gives me a NPE.

    The issue happens in Path#evaluateHttp:`if (event instanceof HttpOutboundServletRewrite)
    url = ((HttpOutboundServletRewrite)event).getOutboundAddress().getPath();`

    Right, but in the case of an external URL like this, in the AddressResult object, host is filled but path is null, thus url == null.
    Then just after, if (url.startsWith(event.getContextPath())) gives the NPE obviously.

    OK the obvious workaround is to remove useless outputLink’s, nonetheless, I find this quite suspicuous. Or is there anything I’m doing wrong?
    My config: Glassfish, JSF 2.1, Rewrite 2.0.4.Final


    Hey, sorry for the late response. Yeah, this looks like a bug. Could you open an issue for that?

    I guess it will work if you add a trailing slash to the URL, right? Something like instead of



    Yes correct, the NPE disappears with a trailing slash.
    OK I’m logging an issue and I think I can submit a patch.


    Awesome! Thank you.

    Perhaps the best starting point would be to provide a failing integration test. But patches for fixing the bug itself are also welcome. 🙂



    Yes I’m going to submit patch+test for

    • This reply was modified 8 years, 6 months ago by  fabmars.
Viewing 5 posts - 1 through 5 (of 5 total)

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

Comments are closed.