Displaying error messages

Hi All,I am writting a class file for field validation, I am supposed to display error messages on the screen on error. Is there any way i can do that without making use of catalog messages (xml file)?Thanx in advance
[238 byte] By [VenkyJava] at [2007-11-26 8:08:09]
# 1
The return value of the validation rule will be displayed on screen as the error message. It need not necessarily be a message catalog entry.
chits98 at 2007-7-6 20:48:43 > top of Java-index,Web & Directory Servers,Directory Servers...
# 2

Thanx alot for the reply.

I am trying to return a string as a error message as a result of the validation which is not getting displayed on the screen, but if i try to throw the exception, exception is displayed correctly on the server console. Please guide me on this.

thanx once again

VenkyJava at 2007-7-6 20:48:43 > top of Java-index,Web & Directory Servers,Directory Servers...
# 3
You are returning a string from the method you are calling? Is this string also the return value of the validation rule?
chits98 at 2007-7-6 20:48:43 > top of Java-index,Web & Directory Servers,Directory Servers...
# 4
Yes my method return datatype is a string, but I dont know how to specify return value for validation rule.I have just invoked my class in validation field.Thanx once again
VenkyJava at 2007-7-6 20:48:43 > top of Java-index,Web & Directory Servers,Directory Servers...
# 5
Did you wrap your invoke in a rule? Can you please quote the code that you are using in the form?
Indranil_Chakraborty at 2007-7-6 20:48:43 > top of Java-index,Web & Directory Servers,Directory Servers...
# 6

No I havent wrapped my invoke part in rule.

Below is the snap shot of the code:

******************************************************************

public string validateZip(String fieldValue) throws Exception {

boolean invalidTF = false;

string message = null;

String regExp = "^[\\w\\-\\s]*$";

try {

//check to see that regulat expression and RE are not null

if (regExp != null && fieldValue != null

&& 0 < fieldValue.length()) {

RE re = new RE(regExp);

if (re.match(fieldValue)) {

invalidTF = true;

}

}

} catch (RESyntaxException ex) {

ex.printStackTrace();

}

if (invalidTF == true) {

//throw new Exception("Please enter value in correct format invalid expression");

message = "invalid format";

}

return message;

}

*******************************************************************

I am expecting Invalid format to appear on the screen

VenkyJava at 2007-7-6 20:48:43 > top of Java-index,Web & Directory Servers,Directory Servers...
# 7
Please check the trace to see if the class is actually being invoked.
Indranil_Chakraborty at 2007-7-6 20:48:43 > top of Java-index,Web & Directory Servers,Directory Servers...
# 8
Yes the class is invoked. I have written some system.out statements, which is getting displayed on the console, and also the exceptions are getting disaplyed. But before doing this I get an error "com.waveset.util.WavesetException: Class Validate not found "
VenkyJava at 2007-7-6 20:48:43 > top of Java-index,Web & Directory Servers,Directory Servers...