Validation Problem
Validation Problem
- Subject: Validation Problem
- From: "Jonathan Fleming" <email@hidden>
- Date: Sat, 26 Apr 2003 08:52:04 +0100
G'Day Dev Heads
Hope you're all well this fine day.
Ok, on with the problem solving.
I have this method as a validation
public String validatePicDescriptionTag(String newPicDescriptionTag)
throws NSValidation.ValidationException {
if ( newPicDescriptionTag.length() > 255 ) {
throw new NSValidation.ValidationException("Your
description of this image should be no more than 255 characters (approx.
30 - 50 words). Please amend your text.");
}
return newPicDescriptionTag;
}
but I keep getting this error
Application: TMIsiteJava
Error: java.lang.NullPointerException //yes I know what this is, please
read on
Reason:
Stack trace: File Line# Method Package
--------------------------------------------------------------------------------
TbClientData.java 80 validatePicDescriptionTag TbClientData
However, for testing purposes, if I change that method to
public String validatePicDescriptionTag(String newPicDescriptionTag)
throws NSValidation.ValidationException {
if ( newPicDescriptionTag == null ||
newPicDescriptionTag.equals("") ) {
throw new NSValidation.ValidationException("Your
description of this image should be no more than 255 characters (approx.
30 - 50 words). Please amend your text.");
}
return newPicDescriptionTag;
}
I get no errors at all and the validation works, so it seams I have a
problem with this statement but I can not see it:
newPicDescriptionTag.length() > 255
Can anyone ease my mind ;^)
Thanks
Jonathan
_________________________________________________________________
Surf together with new Shared Browsing
http://join.msn.com/?page=features/browse&pgmarket=en-gb&XAPID=74&DI=1059
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.