You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mm...@apache.org on 2007/09/24 16:43:05 UTC
svn commit: r578840 -
/myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java
Author: mmarinschek
Date: Mon Sep 24 07:43:04 2007
New Revision: 578840
URL: http://svn.apache.org/viewvc?rev=578840&view=rev
Log:
https://issues.apache.org/jira/browse/MYFACES-1732 (MYFACES-1732): New error-handling doesn't deal with Exceptions in validation-method
Modified:
myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java
Modified: myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java?rev=578840&r1=578839&r2=578840&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java Mon Sep 24 07:43:04 2007
@@ -280,7 +280,7 @@
}
catch (Exception ex)
{
- throw new FacesException("Exception while setting value : "+vb.getExpressionString()+"of component with path : "+_ComponentUtils.getPathToComponent(this),ex);
+ throw new FacesException("Exception while setting value : "+vb.getExpressionString()+" of component with path : "+_ComponentUtils.getPathToComponent(this),ex);
}
}
@@ -333,23 +333,31 @@
public void validate(FacesContext context)
{
if (context == null) throw new NullPointerException("context");
- Object submittedValue = getSubmittedValue();
- if (submittedValue == null) return;
- Object convertedValue = getConvertedValue(context, submittedValue);
+ try {
- if (!isValid()) return;
+ Object submittedValue = getSubmittedValue();
+ if (submittedValue == null) return;
- validateValue(context, convertedValue);
+ Object convertedValue = getConvertedValue(context, submittedValue);
- if (!isValid()) return;
+ if (!isValid()) return;
- Object previousValue = getValue();
- setValue(convertedValue);
- setSubmittedValue(null);
- if (compareValues(previousValue, convertedValue))
+ validateValue(context, convertedValue);
+
+ if (!isValid()) return;
+
+ Object previousValue = getValue();
+ setValue(convertedValue);
+ setSubmittedValue(null);
+ if (compareValues(previousValue, convertedValue))
+ {
+ queueEvent(new ValueChangeEvent(this, previousValue, convertedValue));
+ }
+ }
+ catch (Exception ex)
{
- queueEvent(new ValueChangeEvent(this, previousValue, convertedValue));
+ throw new FacesException("Exception while validating component with path : "+_ComponentUtils.getPathToComponent(this),ex);
}
}