private void addMetaTags ( UIViewRoot root , FacesContext context ) { // Check context-param String viewportParam = BsfUtils . getInitParam ( C . P_VIEWPORT , context ) ; viewportParam = evalELIfPossible ( viewportParam ) ; String content = "width=device-width, initial-scale=1" ; if ( ! viewportParam . isEmpty ( ) && isFalseOrNo ( viewportParam ) ) return ; if ( ! viewportParam . isEmpty ( ) && ! isTrueOrYes ( viewportParam ) ) content = viewportParam ; // Otherwise String viewportMeta = "<meta name=\"viewport\" content=\"" + content + "\"/>" ; UIOutput viewport = new UIOutput ( ) ; viewport . setRendererType ( "javax.faces.Text" ) ; viewport . getAttributes ( ) . put ( "escape" , false ) ; viewport . setValue ( viewportMeta ) ; UIComponent header = findHeader ( root ) ; if ( header != null ) { header . getChildren ( ) . add ( 0 , viewport ) ; } }
Add the viewport meta tag if not disabled from context - param