Reputation: 14126
The
conversion
betweentwo UIInput instances
happens in theProcess
Validations
phase (default), which can be moved toApply Request
Values
phase using theimmediate
attribute set totrue
. ForUIOutput
, theconversion
happens in theRender Response phase.
Consider the snippet-
<h:form>
<h:inputText value="#{bean.value}">
<f:convertNumber minFractionDigits="2" />
</h:inputText>
<br/><br/>
<h:commandButton value="Send" action="#{bean.action()}"/>
</h:form>
with the bean as
public class Bean{
private Integer value = 24;
// getters & setters
}
Firing a GET request.
I see that only 2 phases
are getting c/d
START PHASE RESTORE_VIEW 1
END PHASE RESTORE_VIEW 1
START PHASE RENDER_RESPONSE 6
END PHASE RENDER_RESPONSE 6
For this specific GET
request, where does the conversion phase/ or just conversion
taking place?
Upvotes: 0
Views: 57
Reputation: 1108722
The word "conversion" is ambiguous here. For UIInput
, it is talking about conversion from submitted value (HTTP request parameter) to model value (bean property). Here Converter#getAsObject()
is used. For UIOutput
, it is talking about conversion from model value (bean property) to string (HTML output). Here Converter#getAsString()
is used.
As to your observation, it's helpful to realize that UIInput
is a subclass of UIOutput
. In other words, the conversion from model value to string is happening during render response.
Upvotes: 1