Tomahawk tag library 2.0.
Tag aliasBean
The aliasBean tag allows you to create a temporary name for a real bean.
The temporary name exists (is visible) only to the children of the aliasBean.
One use of this feature is to pass "parameters" from an including page to an
included one. The included page can use any name it desires for beans it needs to
reference, and the including page can then use aliasBean to make those names
refer to the beans it wishes to "pass" as parameters.
Suppose you have a block of components you use often but with different beans. You
can create a separate JSP page (or equivalent) containing these beans, where the
value-bindings refer to some fictive bean name. Document these names as the required
"parameters" for this JSP page. Wherever you wish to use this block you then declare
an alias component mapping each of these "parameters" to whatever beans (or literal
values) you really want to apply the block to, then use jsp:include (or equivalent)
to include the reusable block of components.
Note, however, that AliasBean does not work for component bindings; JSF1.1
just has no mechanism available to set up the alias during the "restore view"
phase while the bindings of its children are being re-established, and then
remove the alias after the child bindings are done.
As a special case, if this component's direct parent is an AliasBeansScope
then the alias (temporary name) is active until the end of the parent
component, rather than the end of this component.
Tag Information |
Tag Class | org.apache.myfaces.custom.aliasbean.AliasBeanTag |
TagExtraInfo Class | None |
Body Content | JSP |
Display Name | None |
Attributes |
Name | Required | Request-time | Type | Description |
alias | false | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| Define the "fictive" name which will be visible to the children
of this component as an alias to the "real" object specified
by the value attribute of this component. |
value | false | false | javax.el.ValueExpression
(must evaluate to java.lang.Object )
| The existing value that the alias can be set to. This can be
a literal string (like "toto") or a reference to an existing
bean (like "#{myBean.member1}"). |
id | false | true | java.lang.String | Get a string which uniquely identifies this UIComponent within the scope of the nearest ancestor NamingContainer
component. The id is not necessarily unique across all components in the current view. |
Variables |
No Variables Defined. |
Output Generated by
Tag Library Documentation Generator.
Java, JSP, and JavaServer Pages are trademarks or
registered trademarks of Sun Microsystems, Inc. in the US and other
countries. Copyright 2002-4 Sun Microsystems, Inc.
4150 Network Circle
Santa Clara, CA 95054, U.S.A.
All Rights Reserved.