[jboss-cvs] jboss-portal/core/src/main/org/jboss/portal/core/portlet/management/actions ...
Boleslaw Dawidowicz
bdaw at o2.pl
Fri Jul 28 03:18:05 EDT 2006
User: bdaw
Date: 06/07/28 03:18:05
Modified: core/src/main/org/jboss/portal/core/portlet/management/actions
PropertyAction.java
Log:
property validation
Revision Changes Path
1.2 +6 -2 jboss-portal/core/src/main/org/jboss/portal/core/portlet/management/actions/PropertyAction.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PropertyAction.java
===================================================================
RCS file: /cvsroot/jboss/jboss-portal/core/src/main/org/jboss/portal/core/portlet/management/actions/PropertyAction.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- PropertyAction.java 27 Jul 2006 20:40:49 -0000 1.1
+++ PropertyAction.java 28 Jul 2006 07:18:05 -0000 1.2
@@ -45,7 +45,7 @@
/**
* @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class PropertyAction
{
@@ -118,12 +118,13 @@
String propertyName = (String)value;
// check for empty string
- if (propertyName.startsWith(" "))
+ if (propertyName == null || propertyName.startsWith(" ") || propertyName.equals(""))
{
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, PropertyAction.ERROR_EMPTY_NAME, PropertyAction.ERROR_EMPTY_NAME);
throw new ValidatorException(message);
}
+
}
public void selectProperty()
@@ -141,7 +142,10 @@
public void updateProperty()
{
+ if(!(getSelectedProperty() == null || getSelectedProperty().equals("") || getSelectedProperty().startsWith(" ")))
+ {
getPortalObjectManager().getSelectedObject().setDeclaredProperty(getSelectedProperty(), getPropertyValue());
}
+ }
}
More information about the jboss-cvs-commits
mailing list