Q:

How to produce favicon  using JSF? 

Is there a way using standard jsf-taglibs, which is rendered to <link> in the browser?  My main goal is to produce a favicon link that should look like this:
<link href="/portal/faces/javax.faces.resource/image/favicon.ico?ln=some.lib" rel="shortcut icon" type="image/x-icon" />

A:

There is no standard JSF component/tag for this. 
You can use #{resource} to convert a JSF resource identifier libraryName:resourceName to its domain-relative URL representation without the need to manually write down the context path, resource path, JSF mapping and query string. 
<link href="#{resource['some.lib:image/favicon.ico']}" rel="shortcut icon" type="image/x-icon" />

If you want to get a step further, then you can always wrap this in a custom tag file in the same line as <h:outputStylesheet> and friends like so:
<my:favicon library="some.lib" name="image/favicon.ico" />

See also:

When to use <ui:include>, tag files, composite components and/or custom components?