Now one can write an external link like <a href="http://ocpsoft.org">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="http://www.someexternalsite.com">, 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 184.108.40.206, JSF 2.1, Rewrite 2.0.4.Final