A resource is basically a I18n string. This component allow us to print whatever resource within a page content.
Resources associated to a given controller are automatically set to the template used by the controller's view.
i.e., a resource with a key "my_resource" associated to a controller will be shown in a placeholder with the same name within the correspondent view template:
Here is my resource content: {$my_resource}
Other resources, even if they are persisted during the session but not directly associated to the executed controller, are not set to the template automatically. To render them, we have the resource component.
Resource tag is resource
i.e.
Here is our session content: <comp:resource key="my_session_resource"/>
We just specify the key the resource has in order to render it within the template content
Another interesting usage of this component is to render parameterized resources. i.e.
my_parameterized_resource = "Dear {0}, this is a parameterized I18n resource"
As we can see, the resource above has a parameter just after the "Dear" word. So we need to specify the value that will be replaced instead of the placeholder. To do that, the resource component has the attribute parameters, which allow us to specify a comma-separate list of values to be replaced by. i.e.
Dear Antuan, this is a parameterized I18n resource
Take into account that you must apply a comma-separated list of pair key,value as parameters.
With template tags we are not able to specify parameters to resources, so this is another usage of this component even if resources belong to the current in execution controller.