myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo Uribe (JIRA)" <>
Subject [jira] [Commented] (MYFACES-3797) cdi support for converters and validators
Date Mon, 07 Oct 2013 09:02:42 GMT


Leonardo Uribe commented on MYFACES-3797:

I have checked the patch and I can see the point. I think the proposed solution does not deal
with the complexity involved in the state handling. Override DeltaStateHelper or the state
handling code is not the right way to deal with state handling issues. In this case, I think
delegation pattern is the way to go. What happen if a converter/validator is marked as Serializable?
what happen if a converter/validator is StateHolder? what happen if it is PartialStateHolder?.
What happen if two different views uses the same converter on the same request? both views
will use the same?

I think it is also valid to do something like this:

public class MyConverterClass implements Converter
   // .... some code goes here ...

A JSF converter or validator that is marked as a bean with a scope. It should be valid syntax,
and I feel that could be useful.

In conclusion, there are different use cases and first we need to check one by one how to
deal with them. The aim is clear: provide a clean integration between CDI and JSF.

I would like something like this:

if (cdiEnabled and this object has been injected using a cdi annotation)
   // ... use a cdi adapter for this stuff or something like that ...)
   // ... do it as usual ...

I need some time to think about this. First we need to solve MYFACES-3786. 

> cdi support for converters and validators
> -----------------------------------------
>                 Key: MYFACES-3797
>                 URL:
>             Project: MyFaces Core
>          Issue Type: New Feature
>          Components: JSR-344
>            Reporter: Gerhard Petracek
>            Assignee: Gerhard Petracek
>         Attachments: MYFACES-3797.patch
> with
>     <context-param>
>         <param-name>org.apache.myfaces.CONVERTER_INJECTION_ENABLED</param-name>
>         <param-value>true</param-value>
>     </context-param>
> and
>     <context-param>
>         <param-name>org.apache.myfaces.VALIDATOR_INJECTION_ENABLED</param-name>
>         <param-value>true</param-value>
>     </context-param>
> it should be possible to enable cdi support for converters/validators.
> we need the config, because it was postponed for the spec.

This message was sent by Atlassian JIRA

View raw message