javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2180

MethodExpressionValidator.validate wraps any exception as ValidationException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.3
    • Fix Version/s: 2.1.16, 2.2.0-m07
    • Component/s: conversion
    • Labels:
      None
    • Environment:

      glassfish 3.1

      Description

      This way one can't distinguish between failed validations and real exceptions. Just rethrow real exceptions as FacesException to let the exception handler handle them correctly.

        Activity

        Hide
        Ed Burns added a comment -

        I agree with this improvement, but I'd like to prioritize correctly.

        Show
        Ed Burns added a comment - I agree with this improvement, but I'd like to prioritize correctly.
        Hide
        Manfred Riem added a comment -

        Frank, after reading the JavaDoc I see it states that it should throw ValidatorException IF the validation fails. So I agree it should not capture other exceptions. However if another exception occurs should it not just bubble up without even wrapping it in a FacesException?

        Show
        Manfred Riem added a comment - Frank, after reading the JavaDoc I see it states that it should throw ValidatorException IF the validation fails. So I agree it should not capture other exceptions. However if another exception occurs should it not just bubble up without even wrapping it in a FacesException?
        Hide
        Frank Caputo added a comment -

        We can only rethrow RuntimeExceptions. That's why I suggested wrapping it in a FacesException.

        Show
        Frank Caputo added a comment - We can only rethrow RuntimeExceptions. That's why I suggested wrapping it in a FacesException.
        Hide
        Manfred Riem added a comment - - edited

        I was suggesting not to rethrow anything. Which means to just let any exception coming from a MethodExpression validation just bubble up. This would be more inline with what people would expect if there is something wrong with their method. After all the implementor of the said method is the one that is responsible to make sure it behaves the same as a regular validator would.

        What do you think?

        Show
        Manfred Riem added a comment - - edited I was suggesting not to rethrow anything. Which means to just let any exception coming from a MethodExpression validation just bubble up. This would be more inline with what people would expect if there is something wrong with their method. After all the implementor of the said method is the one that is responsible to make sure it behaves the same as a regular validator would. What do you think?
        Hide
        Frank Caputo added a comment -

        Ok. That's fine for me.

        Show
        Frank Caputo added a comment - Ok. That's fine for me.
        Hide
        Manfred Riem added a comment -

        Applied to 2.1 branch,

        svn commit -m "Fixes http://java.net/jira/browse/JAVASERVERFACES-2180, r=rogerk, rethrow any exception that is not a ValidatorException so it bubbles up. Rethrow the ValidatorException."
        Sending jsf-api\src\main\java\javax\faces\validator\MethodExpressionValidator.java
        Transmitting file data .
        Committed revision 11129.

        Show
        Manfred Riem added a comment - Applied to 2.1 branch, svn commit -m "Fixes http://java.net/jira/browse/JAVASERVERFACES-2180 , r=rogerk, rethrow any exception that is not a ValidatorException so it bubbles up. Rethrow the ValidatorException." Sending jsf-api\src\main\java\javax\faces\validator\MethodExpressionValidator.java Transmitting file data . Committed revision 11129.
        Hide
        Manfred Riem added a comment -

        Applied to 2.2 trunk,

        svn commit -m "Fixes http://java.net/jira/browse/JAVASERVERFACES-2180, r=rogerk, rethrow any exception that is not a ValidatorException so it bubbles up. Rethrow the ValidatorException."
        Sending jsf-api\src\main\java\javax\faces\validator\MethodExpressionValidator.java
        Transmitting file data .
        Committed revision 11130.

        Show
        Manfred Riem added a comment - Applied to 2.2 trunk, svn commit -m "Fixes http://java.net/jira/browse/JAVASERVERFACES-2180 , r=rogerk, rethrow any exception that is not a ValidatorException so it bubbles up. Rethrow the ValidatorException." Sending jsf-api\src\main\java\javax\faces\validator\MethodExpressionValidator.java Transmitting file data . Committed revision 11130.

          People

          • Assignee:
            Manfred Riem
            Reporter:
            Frank Caputo
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: