|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTagSupport
org.apache.myfaces.orchestra.conversation.jsf.components.ConverterTag
public class ConverterTag
Works like f:converter except that the converter instance is a managed-bean instance rather than a simple class.
In addition, the retrieved Converter instance is (by default) wrapped in a SerializableConverter instance. See the documentation for that class for further details.
This is not actually orchestra-specific functionality; this is something that the JSF core library could offer, or an add-on library such as Tomahawk. But at the current time, no common library offers this feature and the use of a SerializableConverter wrapper is very convenient.
The primary use-case for this tag is custom Converter classes that access conversation state. For example, a Converter may be written to convert an object instance into a string by reading its primary key, and on postback convert the string (a primary key) back into an object instance by loading it using the persistence context associated with a particular conversation. Of course such a converter must be configured with the appropriate Orchestra scope, and therefore must be loaded as a managed bean rather than via the standard f:converter mechanism.
An alternative to using this tag is simply to use the standard "converter" attribute available on most JSF component tags, but if a SerializableConverter wrapper is desired then two bean definitions are needed rather than just one; see class SerializableConverter for details.
Constructor Summary | |
---|---|
ConverterTag()
|
Method Summary | |
---|---|
protected static Converter |
createConverter(java.lang.String beanName)
Override this method in order to customise the bean instance. |
int |
doStartTag()
|
void |
release()
|
void |
setBeanName(java.lang.String beanName)
|
void |
setUseWrapper(boolean enabled)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConverterTag()
Method Detail |
---|
public void setBeanName(java.lang.String beanName)
public void setUseWrapper(boolean enabled)
public int doStartTag() throws JspException
JspException
public void release()
protected static Converter createConverter(java.lang.String beanName) throws JspException
JspException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |