2

I have a similar problem as this post: Warning: This page calls for XML namespace http://www.facebook.com/2008/fbml declared with prefix fb but no taglibrary exists for that namespace

However, in my case, the error is related to SVG elements. I'm attempting to include inline svg:

<div>
  <ui:include src="img/foo.svg" />
</div>

And this is the error I get:

Warning: This page calls for XML namespace http://www.w3.org/2000/svg declared with prefix path but no taglibrary exists for that namespace.

I know that I'm supposed to just ignore the error, but I don't want an error showing up at all. Currently a p:growl shows up with that message. How do I turn of the growl for that particular message? I don't want to remove the p:growl tag completely from the page since it's used for other meaningful error messages.

battmanz
  • 2,266
  • 4
  • 23
  • 32

1 Answers1

1

So is your SVG just an image you could use OmniFaces o:graphicImage like...

<o:graphicImage value="#{images.get(image.id)}" type="svg" />

In your web.xml add...

<mime-mapping>
    <extension>svg</extension>
    <mime-type>image/svg+xml</mime-type>
</mime-mapping>

Or if you want to just render the SVG right on the page with NO image just the raw SVG we have done this before..

<h:outputText escape="false" value="#{bean.mySvg}" />

Where bean.mySVG is a String representation of your "img/foo.svg" you load from disk.

Melloware
  • 10,435
  • 2
  • 32
  • 62
  • Yeah, I think I'm going to have to use the `` technique, but I was hoping I could use ``. I want the SVG rendered directly on the page -- I do not want it inside an `` tag. – battmanz Jul 16 '18 at 23:41
  • Got it . We had to do the same thing and used the h:outputText trick with escape="false" to render the raw SVG to the DOM. – Melloware Jul 16 '18 at 23:44
  • Also you might have to when you load your SVG from disk strip off the header and a few other lines before sending it to the browser. – Melloware Jul 17 '18 at 12:20