Parent Project
Project Documentation

Summary

Tag Name: <trh:meta>
Java Class: org.apache.myfaces.trinidad.component.html.HtmlMeta
Component Type: org.apache.myfaces.trinidad.HtmlMeta

The meta component supports generating an html meta tag for things like reloading the page or configuring viewport characteristics like these:

  • <meta name="viewport" content="width=device-width, user-scalable=no">
  • <meta name="apple-mobile-web-app-capable" content="yes">
  • <meta http-equiv="refresh" content="2;url=./test/index.jspx">
It is also important to note that a meta HTML tag cannot have an ID so the component ID will not be seen in the browser source.

Code Example(s)

Example of three meta tags in a tr:document.

<tr:document ...>
  <f:facet name="metaContainer">
    <tr:group id="metaContainer">
      <trh:meta name="viewport" content="width=device-width, user-scalable=no"/>
      <trh:meta name="apple-mobile-web-app-capable" content="yes"/>
      <trh:meta type="httpEquiv" name="refresh" content="2;url=./test/index.jspx"/>
    </tr:group>
  </f:facet>
</tr:document>

Events

Type Phases Description
org.apache.myfaces.trinidad.event.AttributeChangeEvent Invoke Application,
Apply Request Values
Event delivered to describe an attribute change. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change event might include the width of a column that supported client-side resizing.

Attributes

Name Type Supports EL? Description
attributeChangeListener javax.el.MethodExpression Only EL a method reference to an attribute change listener. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change events might include the width of a column that supported client-side resizing.
binding org.apache.myfaces.trinidad.component.html.HtmlMeta Only EL an EL reference that will store the component instance on a bean. This can be used to give programmatic access to a component from a backing bean, or to move creation of the component to a backing bean.
content String Yes the content for the meta tag
id String No the identifier for the component. Every component may be named by a component identifier that must conform to the following rules:
  • They must start with a letter (as defined by the Character.isLetter() method) or underscore ( _ ).
  • Subsequent characters must be letters (as defined by the Character.isLetter() method), digits as defined by the Character.isDigit() method, dashes ( - ), or underscores ( _ ). To minimize the size of responses generated by JavaServer Faces, it is recommended that component identifiers be as short as possible. If a component has been given an identifier, it must be unique in the namespace of the closest ancestor to that component that is a NamingContainer (if any).
name String Yes the name or the http-equiv attribute for the meta tag (see the type attribute for further configuration)
rendered boolean Yes Default Value: true

whether the component is rendered. When set to false, no output will be delivered for this component (the component will not in any way be rendered, and cannot be made visible on the client). If you want to change a component's rendered attribute from false to true using PPR, set the partialTrigger attribute of its parent component so the parent refreshes and in turn will render this component.
type String Yes Valid Values: name, httpEquiv
Default Value: name

how the name attribute is used. Options are:
  • name - for "name" which is the most common use for meta tags
  • httpEquiv - for "http-equiv" which is the used in some legacy meta tags