574Part IIIAdvanced Features and TechniquesLet s look at (Web hosting script) the

574Part IIIAdvanced Features and TechniquesLet s look at the example covered in Listing 31-3 and consider using custom exceptions. Peoplesigning in using this code may forget to include the usr prefix in their user name, so if it smissing you might want to try adding it and validating again rather than immediately haltingthe program. Listing 31-3:Recovering using custom exceptionsgetMessage()); } } catch(LengthException $ex) { // retrieve the message from the exception object$msg = ($ex->getMessage()); } //define custom exception classesclass PrefixException extends Exception { function __construct($message) { parent::Exception($message); } } class LengthException extends Exception { function __construct($message) {
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.

Leave a Reply