[
https://issues.apache.org/jira/browse/MYFACES-2950?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Leonardo Uribe resolved MYFACES-2950.
-------------------------------------
Resolution: Fixed
Fix Version/s: 2.0.3-SNAPSHOT
> ActionSourceRule does not take into account "action" MethodExpression could
> return Object or Enum
> -------------------------------------------------------------------------------------------------
>
> Key: MYFACES-2950
> URL: https://issues.apache.org/jira/browse/MYFACES-2950
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Affects Versions: 2.0.2
> Environment: using juel
> Reporter: Leonardo Uribe
> Assignee: Leonardo Uribe
> Fix For: 2.0.3-SNAPSHOT
>
>
> Reported by Gerhard Petraceck
> "...action methods are allowed to use void as return type the implementation
> forces a string, el-ri ignores the return type - juel e.g. checks for it and
> fails in case of void...."
> The javadoc of ExpressionFactory.createMethodExpression says this:
> "....If the expression is a String literal, a MethodExpression is created,
> which when invoked, returns the String literal, coerced to
> expectedReturnType. An ELException is thrown if expectedReturnType is void or
> if the coercion of the String literal to the expectedReturnType yields an
> error (see Section "1.16 Type Conversion")..."
> "...expectedReturnType - The expected return type for the method to be found.
> After evaluating the expression, the MethodExpression must check that the
> return type of the actual method matches this type. Passing in a value of
> null indicates the caller does not care what the return type is, and the
> check is disabled...."
> JSF 2.0 section 7.3 says this:
> "... Application action is not a formal JSF API; instead any method that
> meets the following requirements may be used as an Action by virtue of
> evaluating a method binding expression:
> ■ The method must be public.
> ■ The method must take no parameters.
> ■ The method must return Object. ...."
> The conclusion is null should be used as expectedReturnType for create action
> MethodExpressions, instead use String.class.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.