>From: lightbulb432 <[EMAIL PROTECTED]> 
>
> 
> What's the difference between f:attribute and f:param? 
> 
> I noticed that attribute doesn't have properties apart from name and value, 
> while param has binding and id. 
> 
> Also, the value property for attribute takes an Object, while for param it 
> takes only a String. 
> 
> When would you use on vs the other? Apparently they both can be used on 
> UIComponents... 
> --

There are several significant differences between the two.  The f:attribute tag 
is used to set component's attributes.  JSF components have a Map called 
attributes.  This Map has what they call attribute transparency.  This means 
the map looks for a simple java bean property (getter and setter) before adding 
to the attributes map.  You can use this one interfaces to set any of the 
components attributes.  You can also set attributes that are not component 
properties.  These attributes are sometimes used by the renderers and are also 
saved when the components state is saved.  The "f:attribute" Tag is only a JSP 
tag.  It doesn't have a backing component.  JSF/JSP tags do not really have 
anything to do with rendering markup.  For the most part, their responsibility 
is to create the corresponding JSF component and populate the components 
properties with the attributes within the JSP Tag.

The "f:param" tag should only be used as a nested tag under a component for the 
Command family or the outputLink.  It's purpose is similar to the JSTL param 
tag used with the url tag.  The "f:param" tag is used to set query parameters 
or define request parameters you want to propagate from page to page.  Unlike 
the "f:attribute" tag, the f:param creates a backing component (UIParameter).

Gary



> View this message in context: 
> http://www.nabble.com/attribute-vs-param-tf2908869.html#a8126931 
> Sent from the MyFaces - Users mailing list archive at Nabble.com. 
> 

Reply via email to